Certain props are shared across all form-related components, and you can find them in the form wrapper.
By using the class prop, you can apply custom classes or Tailwind CSS classes to customize the appearance and behavior of the gallery, allowing for flexible design changes.
Toggle component
The
toggle
component is a switch-like input used to enable or disable a setting or feature. It provides a clear and interactive way for users to select between two states, such as "on" and "off" or "enabled" and "disabled." With its simple, intuitive design, the
toggle
is often used for settings, preferences, or activating specific features in applications. It enhances the user experience by offering a quick and clear method of making binary choices.
<.toggle_field color="danger" /> <.toggle_field color="dark" /> <.toggle_field color="warning" /> <.toggle_field color="success" /> <.toggle_field color="misc" /> <.toggle_field color="dawn" /> <.toggle_field color="info" /> <.toggle_field color="primary" /> <.toggle_field color="secondary" />
Toggle checked prop
The
checked
prop in the
toggle
component determines whether the toggle is initially set to "on" or "off". When the
checked
prop is set to true, the toggle will be in the "on" position by default. This prop allows you to control the initial state of the toggle, making it useful for settings or features that should be enabled when the form or page is first loaded.
<.toggle_field color="primary" /> <.toggle_field color="secondary" checked={true} />