Lavash.ToggleChip (Lavash v0.3.0-rc.0)

Copy Markdown View Source

A self-contained toggle chip component for boolean state.

Renders a single button that toggles between active/inactive. Handles optimistic updates internally — parent just binds a boolean.

Usage

<.lavash_component
  module={Lavash.ToggleChip}
  id="in-stock-toggle"
  label="In Stock Only"
  active={@in_stock}
  bind={[active: :in_stock]}
/>

Styling

Override with active_class and inactive_class props.