React Suite Skill
This skill helps AI assistants build user interfaces with React Suite v6+. When active, the assistant follows React Suite conventions for components, styling, theming, accessibility, and internationalization.
When to use this skill
Activate this skill whenever the project depends on rsuite (check package.json) or the user asks to build UI with React Suite.
Installation
Install React Suite in the target project:
npm install rsuite
Import the stylesheet once at the application entry:
import 'rsuite/dist/rsuite.min.css';
For component-level imports (recommended for bundle size):
import Button from 'rsuite/Button';
import 'rsuite/Button/styles/index.css';
Core principles
- Prefer built-in components over custom ones. React Suite ships 80+ components. Check availability before building from scratch.
- Compose via
asandrender*props. Most components acceptasto change the rendered element andrenderXprops to override subparts. - Use the
CustomProviderfor global configuration (locale, theme, RTL,classPrefix). - Apply theming through CSS variables (
--rs-*), not by overriding class names. - Use
@rsuite/iconsfor iconography rather than ad-hoc SVGs. - Handle forms with
Form,Form.Group,Form.Control, andSchemafromrsuite. - Respect accessibility: always provide labels for inputs,
aria-*for custom triggers, and keyboard handlers for interactive elements.
Common patterns
Global provider
import { CustomProvider } from 'rsuite';
import zhCN from 'rsuite/locales/zh_CN';
<CustomProvider theme="dark" locale={zhCN}>
<App />
</CustomProvider>;
Button
import { Button } from 'rsuite';
<Button appearance="primary" size="md"
Submit
</Button>;
Valid appearance values: default | primary | link | subtle | ghost.
Valid size values: xs | sm | md | lg.
Valid color values: red | orange | yellow | green | cyan | blue | violet.
Form with validation
import { Form, Schema, Button } from 'rsuite';
const model = Schema.Model({
name: Schema.Types.StringType().isRequired('Name is required.'),
email: Schema.Types.StringType().isEmail('Invalid email.')
});
<Form model={model}
<Form.Group controlId="name">
<Form.ControlLabel>Name</Form.ControlLabel>
<Form.Control name="name" />
</Form.Group>
<Form.Group controlId="email">
<Form.ControlLabel>Email</Form.ControlLabel>
<Form.Control name="email" type="email" />
</Form.Group>
<Button type="submit" appearance="primary">Save</Button>
</Form>;
Table
import { Table } from 'rsuite';
const { Column, HeaderCell, Cell } = Table;
<Table data={data} autoHeight>
<Column flexGrow={1}>
<HeaderCell>Name</HeaderCell>
<Cell dataKey="name" />
</Column>
<Column width={120}>
<HeaderCell>Age</HeaderCell>
<Cell dataKey="age" />
</Column>
</Table>;
Message & toaster
import { useToaster, Message } from 'rsuite';
const toaster = useToaster();
toaster.push(<Message type="success">Saved.</Message>, { placement: 'topCenter' });
Theming
React Suite exposes CSS variables prefixed with --rs-. Override them in your root selector:
:root {
--rs-primary-500: #3498ff;
--rs-text-primary: #1f2d3d;
}
Switch themes at runtime through CustomProvider; the theme prop accepts "light", "dark", or "high-contrast".
See the full variable list at https://rsuitejs.com/guide/css-variables.
Icons
npm install @rsuite/icons
import SearchIcon from '@rsuite/icons/Search';
<Button startIcon={<SearchIcon />}>Search</Button>;
Fetching up-to-date documentation
For live data on components, props, and hooks, prefer the official sources in this order:
- MCP Server —
@rsuite/mcpexposesget_component_props,list_components,list_hooks,search_components. See https://rsuitejs.com/guide/mcp-server. - LLMs.txt — https://rsuitejs.com/llms.txt and https://rsuitejs.com/llms-full.txt.
- Helper scripts bundled with this skill (see below) that hit the public React Suite docs API.
Scripts
Utility scripts are included to fetch component data programmatically:
scripts/list_components.mjs— list all React Suite componentsscripts/get_component_props.mjs <ComponentName>— get props for a specific componentscripts/list_hooks.mjs— list all custom hooksscripts/search_components.mjs <query>— search components by name
Run with Node 18+:
node scripts/list_components.mjs
node scripts/get_component_props.mjs Button
Do / Don't
- Do import
rsuite/dist/rsuite.min.cssonce, globally. - Do use
Form.Control(not rawInput) insideFormso validation is wired automatically. - Do pick semantic
appearance/colorvalues instead of inline styles for state. - Don't mutate component class names directly; override CSS variables instead.
- Don't mix MUI/AntD components with React Suite — choose one system per app.
- Don't hand-roll dropdowns, date pickers, or tree pickers — use
Dropdown,DatePicker,TreePicker.
References
- Documentation: https://rsuitejs.com
- Components: https://rsuitejs.com/components/overview
- GitHub: https://github.com/rsuite/rsuite
- MCP server: https://rsuitejs.com/guide/mcp-server
- LLMs.txt: https://rsuitejs.com/guide/llms
Source: rsuite/rsuite — distributed by TomeVault.