diff --git a/docs/content/docs/2.components/checkbox-group.md b/docs/content/docs/2.components/checkbox-group.md index 3d79f203b0..2ce94ce393 100644 --- a/docs/content/docs/2.components/checkbox-group.md +++ b/docs/content/docs/2.components/checkbox-group.md @@ -64,6 +64,7 @@ You can also pass an array of objects with the following properties: - `description?: string`{lang="ts-type"} - [`value?: string`{lang="ts-type"}](#value-key) - `disabled?: boolean`{lang="ts-type"} +- [`icon?: string`{lang="ts-type"}](#indicator) - `class?: any`{lang="ts-type"} - `ui?: { item?: ClassNameValue, container?: ClassNameValue, base?: ClassNameValue, 'indicator'?: ClassNameValue, icon?: ClassNameValue, wrapper?: ClassNameValue, label?: ClassNameValue, description?: ClassNameValue }`{lang="ts-type"} @@ -82,13 +83,13 @@ props: - 'system' items: - label: 'System' - description: 'This is the first option.' + description: 'Matches your device settings.' value: 'system' - label: 'Light' - description: 'This is the second option.' + description: 'Always uses the light theme.' value: 'light' - label: 'Dark' - description: 'This is the third option.' + description: 'Always uses the dark theme.' value: 'dark' --- :: @@ -118,13 +119,13 @@ props: valueKey: 'id' items: - label: 'System' - description: 'This is the first option.' + description: 'Matches your device settings.' id: 'system' - label: 'Light' - description: 'This is the second option.' + description: 'Always uses the light theme.' id: 'light' - label: 'Dark' - description: 'This is the third option.' + description: 'Always uses the dark theme.' id: 'dark' --- :: @@ -196,6 +197,8 @@ ignore: - items external: - items +externalTypes: + - CheckboxGroupItem[] items: color: - primary @@ -213,11 +216,17 @@ props: color: 'primary' variant: 'card' defaultValue: - - 'System' + - 'system' items: - - 'System' - - 'Light' - - 'Dark' + - label: 'System' + value: 'system' + description: 'Matches your device settings.' + - label: 'Light' + value: 'light' + description: 'Always uses the light theme.' + - label: 'Dark' + value: 'dark' + description: 'Always uses the dark theme.' --- :: @@ -283,6 +292,10 @@ props: Use the `indicator` prop to change the position or hide the indicator. Defaults to `start`. +::note +An item's `icon` replaces the check mark while the indicator is visible, and is displayed above the label when it is `hidden`. :badge{label="Soon" color="info" class="float-right ms-auto text-right"} +:: + ::component-code --- prettier: true @@ -291,6 +304,8 @@ ignore: - items external: - items +externalTypes: + - CheckboxGroupItem[] items: indicator: - start @@ -301,14 +316,24 @@ items: - card - table props: - indicator: 'end' - variant: 'card' + indicator: 'hidden' + orientation: 'horizontal' + variant: 'table' defaultValue: - 'System' items: - - 'System' - - 'Light' - - 'Dark' + - label: 'System' + icon: 'i-lucide-monitor' + value: 'System' + class: 'w-20' + - label: 'Light' + icon: 'i-lucide-sun' + class: 'w-20' + value: 'Light' + - label: 'Dark' + icon: 'i-lucide-moon' + class: 'w-20' + value: 'Dark' --- :: diff --git a/docs/content/docs/2.components/checkbox.md b/docs/content/docs/2.components/checkbox.md index 5704e5125c..8f2d1e61b0 100644 --- a/docs/content/docs/2.components/checkbox.md +++ b/docs/content/docs/2.components/checkbox.md @@ -194,14 +194,21 @@ props: Use the `indicator` prop to change the position or hide the indicator. Defaults to `start`. +::note +When `indicator` is `hidden`, the icon is displayed above the label instead. :badge{label="Soon" color="info" class="float-right ms-auto text-right"} +:: + ::component-code --- +prettier: true ignore: - label + - icon - defaultValue props: - indicator: 'end' + indicator: 'hidden' variant: 'card' + icon: 'i-lucide-heart' defaultValue: true label: Check me --- diff --git a/docs/content/docs/2.components/radio-group.md b/docs/content/docs/2.components/radio-group.md index 40fc431639..7c2722ef1f 100644 --- a/docs/content/docs/2.components/radio-group.md +++ b/docs/content/docs/2.components/radio-group.md @@ -61,8 +61,9 @@ You can also pass an array of objects with the following properties: - `description?: string`{lang="ts-type"} - [`value?: string`{lang="ts-type"}](#value-key) - `disabled?: boolean`{lang="ts-type"} +- [`icon?: string`{lang="ts-type"}](#indicator) - `class?: any`{lang="ts-type"} -- `ui?: { item?: ClassNameValue, container?: ClassNameValue, base?: ClassNameValue, 'indicator'?: ClassNameValue, wrapper?: ClassNameValue, label?: ClassNameValue, description?: ClassNameValue }`{lang="ts-type"} +- `ui?: { item?: ClassNameValue, container?: ClassNameValue, base?: ClassNameValue, 'indicator'?: ClassNameValue, wrapper?: ClassNameValue, label?: ClassNameValue, icon?: ClassNameValue, description?: ClassNameValue }`{lang="ts-type"} ::component-code --- @@ -78,13 +79,13 @@ props: modelValue: 'system' items: - label: 'System' - description: 'This is the first option.' + description: 'Matches your device settings.' value: 'system' - label: 'Light' - description: 'This is the second option.' + description: 'Always uses the light theme.' value: 'light' - label: 'Dark' - description: 'This is the third option.' + description: 'Always uses the dark theme.' value: 'dark' --- :: @@ -113,13 +114,13 @@ props: valueKey: 'id' items: - label: 'System' - description: 'This is the first option.' + description: 'Matches your device settings.' id: 'system' - label: 'Light' - description: 'This is the second option.' + description: 'Always uses the light theme.' id: 'light' - label: 'Dark' - description: 'This is the third option.' + description: 'Always uses the dark theme.' id: 'dark' --- :: @@ -184,18 +185,18 @@ externalTypes: - RadioGroupItem[] props: color: 'primary' - variant: 'table' - defaultValue: 'pro' + variant: 'card' + defaultValue: 'system' items: - - label: 'Pro' - value: 'pro' - description: 'Tailored for indie hackers, freelancers and solo founders.' - - label: 'Startup' - value: 'startup' - description: 'Best suited for small teams, startups and agencies.' - - label: 'Enterprise' - value: 'enterprise' - description: 'Ideal for larger teams and organizations.' + - label: 'System' + value: 'system' + description: 'Matches your device settings.' + - label: 'Light' + value: 'light' + description: 'Always uses the light theme.' + - label: 'Dark' + value: 'dark' + description: 'Always uses the dark theme.' --- :: @@ -249,6 +250,10 @@ props: Use the `indicator` prop to change the position or hide the indicator. Defaults to `start`. +::note +An item's `icon` is only displayed when `indicator` is `hidden`, above the label, since a radio has no icon inside its indicator. :badge{label="Soon" color="info" class="float-right ms-auto text-right"} +:: + ::component-code --- prettier: true @@ -257,14 +262,35 @@ ignore: - items external: - items +externalTypes: + - RadioGroupItem[] +items: + indicator: + - start + - end + - hidden + variant: + - list + - card + - table props: - indicator: 'end' - variant: 'card' + indicator: 'hidden' + orientation: 'horizontal' + variant: 'table' defaultValue: 'System' items: - - 'System' - - 'Light' - - 'Dark' + - label: 'System' + icon: 'i-lucide-monitor' + value: 'System' + class: 'w-20' + - label: 'Light' + icon: 'i-lucide-sun' + value: 'Light' + class: 'w-20' + - label: 'Dark' + icon: 'i-lucide-moon' + value: 'Dark' + class: 'w-20' --- :: diff --git a/playgrounds/nuxt/app/pages/components/checkbox-group.vue b/playgrounds/nuxt/app/pages/components/checkbox-group.vue index 14033d2b3d..f7387bf142 100644 --- a/playgrounds/nuxt/app/pages/components/checkbox-group.vue +++ b/playgrounds/nuxt/app/pages/components/checkbox-group.vue @@ -32,6 +32,11 @@ const itemsWithDescription = [ { value: '2', label: 'Option 2', description: 'Description 2' }, { value: '3', label: 'Option 3', description: 'Description 3' } ] +const itemsWithIcon = [ + { value: '1', label: 'System', icon: 'i-lucide-monitor' }, + { value: '2', label: 'Light', icon: 'i-lucide-sun' }, + { value: '3', label: 'Dark', icon: 'i-lucide-moon' } +]