More in Learn

Switch Component

The switch component holds a boolean state: yes or no.

Switch Component Usage

The switch component is easily switched on and off by clicking, allowing you to manage boolean states in a semantically described component. For example, if you’re selling cars, you can use the switch component to indicate whether the car is electric. For an online magazine, you could use this component to determine whether an article should be available for free.

When adding this component to a shape or piece, you can specify the following:

  • Name (required) - A name for the component.
  • Identifier - String that will be generated based on the component name when shape/piece is created or updated. You’ll use the identifier to reference the component programmatically.
  • Description - An optional description of what the component should contain. This will be visible to anyone who adds content to the component later.
  • Localized Content - If Yes, then you can store different values for each language set up within your tenant. If No, then the same value will be shared across all languages.
Switch component on shapeSwitch component usage

Catalogue API Access

Once created, switch components and their content are accessible via the Catalogue API. Refer to our sample query for retrieving switch component content, and to the API docs at https://api.crystallize.com/your-tenant-identifier/catalogue for more information.

People showing thumbs up

Need further help?

Join and ask our
slack community.

Join our slack community