funkwhale/front/ui-docs/components/ui/toggle.md

39 wiersze
917 B
Markdown
Czysty Zwykły widok Historia

<script setup lang="ts">
import { ref } from 'vue'
const toggle = ref(false)
const toggle2 = ref(false)
</script>
# Toggle
Toggles are basic form inputs that visually represent a boolean value. Toggles can be **on** (`true`) or **off** (`false`).
| Prop | Data type | Required? | Description |
| --------------- | --------- | --------- | ---------------------------------------- |
| `big` | Boolean | No | Controls whether a toggle is big or not. |
| `v-model:value` | Boolean | Yes | The value controlled by the toggle. |
## Normal toggle
Link your toggle to an input using the `v-model` directive.
```vue-html
<fw-toggle v-model="toggle" />
```
<fw-toggle v-model="toggle" />
## Big toggle
Pass a `big` prop to create a larger toggle.
```vue-html{2}
<fw-toggle
big
v-model="toggle"
/>
```
<fw-toggle big v-model="toggle2" />