VaneUI

VaneUI

Getting Started

Usage Basics

Learn fundamental patterns and concepts for using VaneUI components effectively.

Learn the fundamental patterns for using VaneUI components.

Component Props

VaneUI components use boolean props for styling. Most components support size, appearance, and layout props.

Size Props

Components support five sizes:

react-icon
import { Button, Stack } from '@vaneui/ui';

function SizeExample() {
  return (
    <Stack>
      <Button xs>Extra Small</Button>
      <Button sm>Small</Button>
      <Button md>Medium</Button>
      <Button lg>Large</Button>
      <Button xl>Extra Large</Button>
    </Stack>
  );
}

Appearance Props

Control visual appearance with semantic props:

react-icon
import { Button, Row } from '@vaneui/ui';

function AppearanceExample() {
  return (
    <Row>
      <Button default>Default</Button>
      <Button primary>Primary</Button>
      <Button secondary>Secondary</Button>
      <Button success>Success</Button>
      <Button danger>Danger</Button>
      <Button warning>Warning</Button>
    </Row>
  );
}

Shape Props

Control border radius:

react-icon
import { Button, Card, Row } from '@vaneui/ui';

function ShapeExample() {
  return (
    <Row>
      <Button sharp>Sharp</Button>
      <Button rounded>Rounded</Button>
      <Button pill>Pill</Button>
    </Row>
  );
}

Layout Components

Stack

Arrange children with consistent spacing:

react-icon
import { Stack, Text } from '@vaneui/ui';

function StackExample() {
  return (
    <Stack lg>
      <Text>Item 1</Text>
      <Text>Item 2</Text>
      <Text>Item 3</Text>
    </Stack>
  );
}

Row and Col

Create flexible layouts:

react-icon
import { Row, Col, Card } from '@vaneui/ui';

function GridExample() {
  return (
    <Row>
      <Col>
        <Card>Column 1</Card>
      </Col>
      <Col>
        <Card>Column 2</Card>
      </Col>
    </Row>
  );
}

Typography

VaneUI provides typography components with consistent hierarchy:

react-icon
import { PageTitle, SectionTitle, Title, Text } from '@vaneui/ui';

function TypographyExample() {
  return (
    <Stack>
      <PageTitle>Page Title</PageTitle>
      <SectionTitle>Section Title</SectionTitle>
      <Title>Subsection Title</Title>
      <Text>Body text</Text>
    </Stack>
  );
}

Responsive Props

Hide components on specific breakpoints:

react-icon
import { Text, Stack } from '@vaneui/ui';

function ResponsiveExample() {
  return (
    <Stack>
      <Text>Always visible</Text>
      <Text smHide>Hidden on small screens</Text>
      <Text mdHide>Hidden on medium screens</Text>
      <Text lgHide>Hidden on large screens</Text>
    </Stack>
  );
}

Custom HTML Tags

Use the tag prop to render different HTML elements:

react-icon
import { Text, Button } from '@vaneui/ui';

function TagExample() {
  return (
    <div>
      <Text tag="h1">Heading</Text>
      <Text tag="span">Span text</Text>
      <Button tag="a" href="/link">Link Button</Button>
    </div>
  );
}