Any state or a group of states connected to other modeling components can be saved as a reusable component. A component can be fully functional or can serve as an example, template or a design pattern.
On one hand you can start from scratch and create a new design. Alternatively you can take an existing model and carve out a subset of the modeling components for use as a reusable component.
In both cases you begin by creating a new model for the reusable component using the New menu item from the File menu. After naming the model, you should add a description by selecting Edit Comment from the Script menu. Describe the functionality that the component provides and importantly, describe how the it should be used and integrated into other script models.
At this point you can either create a new design or select and copy one or more existing components from an existing model, and paste them into the model for the reusable component.
►Note: A script model serving as a reusable component must not have any transitions to either the Initial Point or the border of the top-level state, as these will be discarded when the component is reused. As well, any State Variables & Functions defined at the top-level state, together with any Custom Globals will be discarded.
Most reusable components will require some measure of customization when reused. See Configurable Components on how to set the properties of a state component to be configurable by users of that component.
The reusable component can then be saved by selecting the Save As menu item from the File menu. Choose a name for the file in the dialog, and then navigate to the location of your Library folder, and save the file.
See Importing Reusable Components to see how to import and incorporate a component from the Component Library Browser into your model.