@runstack/ui
Version:
React UI components library for runstack
80 lines (55 loc) • 1.13 kB
Markdown
A collection of reusable React UI components for runstack applications.
```bash
npm install @runstack/ui
```
- React >= 18.0.0
- React DOM >= 18.0.0
```tsx
import { DraggableList } from '@runstack/ui/draggable-list'
function MyComponent() {
const items = [
{ id: '1', title: 'Item 1' },
{ id: '2', title: 'Item 2' },
{ id: '3', title: 'Item 3' }
]
const handleReorder = (newItems) => {
// Handle reordered items
}
return (
<DraggableList
items={items}
onReorder={handleReorder}
/>
)
}
```
```tsx
import { cn } from '@runstack/ui'
// Merge classes with tailwind-merge
const className = cn('base-class', 'additional-class', {
'conditional-class': condition
})
```
- **DraggableList**: A drag-and-drop sortable list component with editing capabilities
```bash
npm install
npm test
npm run test:watch
npm run build
npm run lint
```
MIT