intent-react
v2.0.1
Published
React components for Intent styling framework
Downloads
425
Maintainers
Readme
intent-react
React components for the Intent styling framework.
Installation
npm install intent-react
# or
pnpm add intent-react
# or
yarn add intent-reactQuick Start
import { Stack, Button, Text, Card } from 'intent-react';
function App() {
return (
<Stack direction="column" gap="relaxed">
<Text size="xl" weight="bold">Welcome to Intent</Text>
<Card elevation="low" padding="normal">
<Stack direction="row" gap="normal">
<Button importance="primary">Save</Button>
<Button importance="secondary">Cancel</Button>
</Stack>
</Card>
</Stack>
);
}Components
Layout
Stack,VStack,HStack- Flexbox layoutsContainer- Centered content containerGrid,GridItem- CSS Grid systemBox- Generic layout primitiveAspectRatio- Maintain aspect ratioCenter- Center contentSpacer- Flexible spacingShow,Hide- Responsive visibility
Typography
Heading,H1-H6- Section headingsText- Body text with variantsParagraph,P- Paragraph blocksList,ListItem,Ul,Ol,Li- ListsCode- Inline codeQuote,Blockquote- QuotationsProse- Article contentKbd- Keyboard inputMark,Highlight- Highlighted text
Forms
Input,InputField- Text inputTextarea,TextareaField- Multi-line inputSelect,SelectField- Dropdown selectCheckbox,CheckboxField- Checkbox inputRadio,RadioField- Radio inputSwitch,SwitchField- Toggle switchLabel- Form labelsField- Form field wrapperForm- Form container with context
Feedback
Alert- Status messagesProgress- Progress barsSpinner- Loading indicatorsSkeleton,SkeletonText- Loading placeholders
Overlay
Modal- Dialog windowsDrawer- Slide-out panelsTooltip- Hover informationPopover- Floating contentMenu- Dropdown menus
Navigation
Tabs,Tab,TabPanel- Tab navigationBreadcrumbs,BreadcrumbItem- Path navigationPagination,PaginationItem- Page navigationLink- Styled anchorsNav,NavItem- Navigation listsCommand,CommandDialog- Command paletteSteps,Step- Step indicatorsSidebar- Side navigationNavbar- Top navigation
Data Display
Table,TableHeader,TableRow,TableCell- Data tablesStat,StatLabel,StatValue- Statistics displayTimeline,TimelineItem- Chronological displayDescriptionList,DescriptionTerm,DescriptionDetail- Key-value pairsTree,TreeItem- Hierarchical dataCalendar,CalendarDay- Date displayCardMedia,CardHeader,CardFooter- Card parts
Example Usage
import {
VStack,
HStack,
Button,
Input,
Card,
Text,
Modal
} from 'intent-react';
function Example() {
const [isOpen, setIsOpen] = useState(false);
return (
<VStack gap="relaxed" padding="normal">
<Text size="2xl" weight="bold">Settings</Text>
<Card elevation="low">
<VStack gap="normal">
<Input placeholder="Your name" />
<Input type="email" placeholder="Email address" />
<HStack gap="normal" justify="end">
<Button importance="ghost" onClick={() => setIsOpen(false)}>
Cancel
</Button>
<Button importance="primary" onClick={() => setIsOpen(true)}>
Save Changes
</Button>
</HStack>
</VStack>
</Card>
<Modal open={isOpen} onOpenChange={setIsOpen}>
<Text>Settings saved successfully!</Text>
</Modal>
</VStack>
);
}License
MIT © Intent Framework Contributors
