Sha256: f833e2d6b4b5846d9ad23eff56b0c261b4e2d291b270c6dc98c7d1c2dbda886f

Contents?: true

Size: 872 Bytes

Versions: 6

Compression:

Stored size: 872 Bytes

Contents

<p class="leading-7 [&:not(:first-child)]:mt-6">The Switch component introduces:</p>

<ul class="my-6 ml-6 list-disc [&>li]:mt-2 text-sm">
  <li><%= code("app/helpers/components/switch_helper.rb") %></li>
  <li><%= code("app/javascript/controllers/ui/switch_controller.js") %></li>
  <li><%= code("app/views/components/ui/_switch.html.erb") %></li>
</ul>

<p class="leading-7 [&:not(:first-child)]:mt-6">
<%= code("render_switch") %> accepts one argument for the text near the switch and two keyword arguments for the <%= code("id") %> of the button and <%= code("name") %> of the hidden input element used to pass the form value of the state. It optionally accepts a <%= code("state") %> keyword for the starting value of the switch.
The javascript controller is responsible for the toggle effect by changing the <%= code("data-state") %> of the underlying elements.</p>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shadcn-ui-0.0.15 app/views/examples/components/switch/_usage.html.erb
shadcn-ui-0.0.14 app/views/examples/components/switch/_usage.html.erb
shadcn-ui-0.0.13 app/views/examples/components/switch/_usage.html.erb
shadcn-ui-0.0.12 app/views/examples/components/switch/_usage.html.erb
shadcn-ui-0.0.10 app/views/examples/components/switch/_usage.html.erb
shadcn-ui-0.0.8 app/views/examples/components/switch/_usage.html.erb