Skip to content

Latest commit

 

History

History
78 lines (63 loc) · 1.46 KB

VIcon.stories.mdx

File metadata and controls

78 lines (63 loc) · 1.46 KB

import { ArgsTable, Canvas, Description, Meta, Story, } from "@storybook/addon-docs"

import VIcon from "~/components/VIcon/VIcon.vue"

import spriteData from "~svgsprite/sprites.json"

export const iconNames = spriteData.reduce((accumulator, sprite) => { const iconsWithNamespace = sprite.symbols.map((symbol) => sprite.defaultSprite ? symbol : ${sprite.name}/${symbol} ) return accumulator.concat(iconsWithNamespace) }, [])

export const Template = (args) => ({ template: <VIcon v-bind="args" />, components: { VIcon }, setup() { return { args } }, })

Icon

To display the icon, pass the name of the icon as a prop.

<VIcon name="icon-name" />
{Template.bind({})}

RTL

VIcon can flip the icon for RTL languages. This is useful for certain icons that have an intrinsic directional nature such as those involving arrows.

To see the RTL layout, switch to the Canvas tab and toggle the directionality using the 🌐 button.

{Template.bind({})}