mirror of
https://github.com/luxdao/stack.git
synced 2026-10-30 18:13:59 +00:00
2.3 KiB
2.3 KiB
@luxdao/ui
Lux DAO UI Component Library - A collection of reusable React components built with Chakra UI for the Lux DAO ecosystem.
Installation
npm install @luxdao/ui
# or
pnpm add @luxdao/ui
# or
yarn add @luxdao/ui
Prerequisites
This library requires the following peer dependencies:
{
"@chakra-ui/react": "^2.8.2",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
}
Usage
First, wrap your application with the Lux theme provider:
import { ChakraProvider } from '@chakra-ui/react';
import { luxTheme } from '@luxdao/ui';
function App() {
return (
<ChakraProvider theme={luxTheme}>
{/* Your app */}
</ChakraProvider>
);
}
Then use the components:
import { Badge, Card, LuxTooltip } from '@luxdao/ui';
function MyComponent() {
return (
<Card>
<LuxTooltip label="This is a tooltip">
<Badge labelKey="active" size="base" />
</LuxTooltip>
</Card>
);
}
Components
Layout
Card- Basic card containerContentBox- Content container with titleInfoBox- Information display box
Badges & Status
Badge- Status badge with various statesQuorumBadge- Quorum status indicatorStatusBox- Status display component
Forms
AddressInput- Ethereum address inputBigIntInput- Big integer input fieldDatePicker- Date selection componentLabelWrapper- Form label wrapper
Navigation
Breadcrumbs- Navigation breadcrumbsNavigationLink- Navigation link component
Feedback
LuxTooltip- Custom tooltip componentBarLoader- Loading bar indicatorCircleLoader- Circular loading indicator
Utils
AddressCopier- Copy address to clipboardDisplayAddress- Format and display addressesExternalLink- External link component
Development
# Install dependencies
pnpm install
# Start development mode
pnpm dev
# Build the library
pnpm build
# Run tests
pnpm test
# Start Storybook
pnpm storybook
Theme Customization
The library exports a default theme that can be extended:
import { extendTheme } from '@chakra-ui/react';
import { luxTheme } from '@luxdao/ui';
const customTheme = extendTheme({
colors: {
brand: {
500: '#custom-color',
},
},
}, luxTheme);
License
MIT