@sentio/ui-core
v0.1.4
Published
A basic UI component library with zero Web3 dependencies.
Keywords
Readme
@sentio/ui-core
A basic UI component library with zero Web3 dependencies.
Features
- 🎨 Full Tailwind CSS theme system
- 🧩 Core UI components (Button, Dialog, Tooltip, Loading, etc.)
- 📦 No Web3 dependency
- 🎯 Lightweight
Installation
pnpm add @sentio/ui-coreUsage
import {
Button,
BaseDialog,
BarLoading,
CopyButton,
Input,
Select,
Switch,
PopoverTooltip,
ResizeTable,
FlatTree,
useMobile
} from '@sentio/ui-core'
import '@sentio/ui-core/dist/style.css'
function App() {
const isMobile = useMobile()
return (
<>
<Button>Click me</Button>
<BarLoading />
<CopyButton text="Copy this" />
<Input placeholder="Enter text" />
{!isMobile && <p>Desktop view</p>}
</>
)
}Included components
Common Components
BarLoading- Bar loading indicatorSpinLoading- Spinner loading indicatorCopyButton,CopyIcon,CopySuccessIcon- Copy button and iconsButton- Button component with loading state supportBaseDialog,BaseZIndexContext- Dialog component with z-index contextPopoverTooltip- Tooltip componentDisclosurePanel- Disclosure panel componentCollapse- Collapse/expand componentInput- Input componentRadioSelect- Radio select componentSwitch- Switch toggle componentSelect- Select dropdown componentFlatTree- Tree component with flat data structureLinkifyText- Text component that converts URLs to linksEmpty- Empty state componentStatusBadge,StatusRole- Status badge componentsHeaderToolsToggleButton,HeaderToolsContent- Header tools dropdown
Table Components
ResizeTable- Resizable table componentMoveLeftIcon,MoveRightIcon,RenameIcon,DeleteIcon- Table action icons
Menu Components
PopupMenuButton- Popup menu buttonMenuItem,SubMenuButton,MenuContext,COLOR_MAP- Menu system components
Tree Components
ROOT_KEY,SUFFIX_NODE_KEY- Tree node key constantsPlusSquareO,MinusSquareO,CloseSquareO,EyeO- Tree icons
Utilities & Hooks
useMobile()- Detect mobile deviceuseBoolean()- Boolean state hook- Number formatting utilities (e.g.,
getNumberWithDecimal()) classNames()- Classname utility- Contexts:
NavSizeContext,BaseZIndexContext,MenuContext - Extension context utilities
Theming
Components are themed using CSS variables. You can customize the theme by overriding these variables:
:root {
--primary-600: 7, 86, 213;
--gray-600: 75, 85, 99;
/* ... */
}