### Install @coze-arch/pkg-root-webpack-plugin Source: https://github.com/coze-dev/rush-arch/blob/main/packages/utils/pkg-root-webpack-plugin/README.md Add the package to your project's dependencies in package.json and run 'rush update' to install. ```json { "dependencies": { "@coze-arch/pkg-root-webpack-plugin": "workspace:*" } } ``` -------------------------------- ### Run Development Server Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/README.md Use this command to start the local development server for coze-design. ```bash rushx dev ``` -------------------------------- ### Example output of `clear-build-cache` Source: https://context7.com/coze-dev/rush-arch/llms.txt Illustrates the typical output when the `clear-build-cache` script is executed, showing which directories and files are cleaned. ```sh # Output example: # Clean common/temp/build-cache # Clean packages/utils/logger/tsconfig.tsbuildinfo # Clean packages/utils/logger/.eslintcache # Clean packages/components/coze-design/lib ``` -------------------------------- ### Start npm MCP Server CLI Source: https://context7.com/coze-dev/rush-arch/llms.txt Use this command to start the MCP server in HTTP/SSE mode for IDE integrations or stdio mode for direct terminal/LLM use. For HTTP mode, specify the port. The stdio mode communicates over stdin/stdout. ```sh npx @coze-arch/npm-mcp-server@latest serve --port 3000 ``` ```sh npx @coze-arch/npm-mcp-server@latest start ``` -------------------------------- ### Install Rush Globally Source: https://github.com/coze-dev/rush-arch/blob/main/README.md Install the Microsoft Rush tool globally if it's not already present on your system. This is a prerequisite for monorepo development. ```sh npm install -g @microsoft/rush ``` -------------------------------- ### Run NPM MCP Server Locally Source: https://github.com/coze-dev/rush-arch/blob/main/README.md If developing locally, navigate to the 'mcp/npm' directory and use this command to start the HTTP server. ```sh cd mcp/npm npm run serve ``` -------------------------------- ### Line Progress Examples Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/progress/index.mdx Demonstrates basic line progress with default settings, custom height, and custom stroke color. ```tsx import { Progress } from '@coze-arch/coze-design'; ``` -------------------------------- ### Start NPM MCP Server on a Custom Port Source: https://github.com/coze-dev/rush-arch/blob/main/packages/mcp/npm/README.md Specify a custom port when starting the server using npx. The server will be accessible at http://localhost:/sse. ```sh npx @coze-arch/npm-mcp-server@latest serve --port 4000 ``` -------------------------------- ### Update and Install Monorepo Dependencies Source: https://github.com/coze-dev/rush-arch/blob/main/README.md After cloning, run this command to ensure all project dependencies within the monorepo are updated and installed correctly. ```sh rush update ``` -------------------------------- ### Basic Usage of PkgRootWebpackPlugin Source: https://github.com/coze-dev/rush-arch/blob/main/packages/utils/pkg-root-webpack-plugin/README.md Import and use the PkgRootWebpackPlugin in your project. Specific usage examples are pending. ```typescript import { /* exported functions/components */ } from '@coze-arch/pkg-root-webpack-plugin'; // Example usage // TODO: Add specific usage examples ``` -------------------------------- ### Badge Positioning Examples Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/badge/index.mdx Illustrates how to position the Badge component using the 'position' prop, including rightTop and rightBottom. ```tsx import { Badge } from '@coze-arch/coze-design'; BD BD ``` -------------------------------- ### Search npm Packages via MCP Client Source: https://context7.com/coze-dev/rush-arch/llms.txt This TypeScript example demonstrates how to use the MCP client to search for npm packages. It connects to an SSE transport, calls the 'searchNpmPackages' tool with various filters and pagination options, and then parses the results. Ensure the client is configured with necessary capabilities. ```typescript import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js'; const transport = new SSEClientTransport(new URL('http://localhost:3000/sse')); const client = new Client({ name: 'my-client', version: '1.0.0' }, { capabilities: { tools: {} }, }); await client.connect(transport); const result = await client.callTool({ name: 'searchNpmPackages', arguments: { keyword: 'state management', size: 5, from: 0, quality: 0.65, // 0–1, default 0.65 popularity: 0.98, // 0–1, default 0.98 maintenance: 0.5, // 0–1, default 0.5 registry: 'https://registry.npmjs.org', // or 'https://registry.npmmirror.com' }, }); const packages = JSON.parse(result.content[0].text); // [ // { // package: { // name: 'redux', version: '5.0.1', description: '...', keywords: [...], // author: '...', publisher: { username: '...', email: '...' }, date: '...' // }, // score: { final: 0.92, detail: { popularity: 0.98, quality: 0.87, maintenance: 0.91 } }, // searchScore: 100000.321 // }, ... // ] await client.close(); ``` -------------------------------- ### Start NPM MCP Server in Terminal Mode with NPX Source: https://github.com/coze-dev/rush-arch/blob/main/README.md This command starts the NPM MCP Server in terminal mode using npx, suitable for direct execution. ```sh npx @coze-arch/npm-mcp-server@latest start ``` -------------------------------- ### Closable Banner Example Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/banner.mdx Illustrates how to make a banner closable using the 'closeIcon' prop. The example also shows how to implement custom closing logic with a 'useState' hook and a custom close action. ```tsx import { Banner } from '@coze-arch/coze-design'; import { useState } from 'react'; const Demo = () => { const [visible, setVisible] = useState(true); return visible ? ( 这是一条可关闭的提示信息 setVisible(false)} > 不再显示 } /> ) : null; }; export default Demo; ``` -------------------------------- ### Banner as Card Example Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/banner/index.mdx Shows how to style the Banner component to resemble a card by setting `card=true` and `fullMode=false`. Includes a title, description, and a call-to-action button. ```tsx import { Banner } from '@coze-arch/coze-design';
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Don't Show Again
} >
``` -------------------------------- ### Serve NPM MCP Server with NPX Source: https://github.com/coze-dev/rush-arch/blob/main/README.md Use this command to directly run the NPM MCP Server without cloning the repository. It starts the server on port 3000 by default. ```sh npx @coze-arch/npm-mcp-server@latest serve ``` -------------------------------- ### Badge Component Examples Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/badge/index.mdx Demonstrates different types and usages of the Badge component, including default, alt, and mini types, with counts and custom styles. ```tsx import { Badge } from '@coze-arch/coze-design'; BD Bot竞技场 BD ``` -------------------------------- ### CozInputNumber Size Examples Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/input-number/index.mdx Demonstrates how to set the size of the CozInputNumber component using the 'size' prop. Supports 'default' and 'small' presets. ```tsx import { CozInputNumber } from '@coze-arch/coze-design'; ``` -------------------------------- ### Circle Progress Examples Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/progress/index.mdx Shows circle progress with default settings and a custom stroke color. Note: 'type="width"' in the source appears to be a typo and should likely be 'type="circle"'. ```tsx import { Progress } from '@coze-arch/coze-design'; ``` -------------------------------- ### Custom Illustration Sizing Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/illustration.mdx This example demonstrates how to apply arbitrary custom dimensions to an illustration using the width and height props, overriding default or predefined sizes. ```tsx import { IconCozIllusDone } from '@coze-arch/coze-design/illustrations'; const Demo = () => (
); export default Demo; ``` -------------------------------- ### Progress Size Variants Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/progress.mdx Demonstrates the three preset sizes (small, default, large) for the Progress component, including a custom height example for the default size. ```tsx import { Progress } from '@coze-arch/coze-design'; const Demo = () => (
); export default Demo; ``` -------------------------------- ### Build Project Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/README.md Execute this command to build the coze-design project for production. ```bash rushx build ``` -------------------------------- ### Run npm MCP Server CLI Source: https://context7.com/coze-dev/rush-arch/llms.txt Instructions on how to run the @coze-arch/npm-mcp-server using its CLI for both HTTP/SSE and stdio modes. ```APIDOC ## Run npm MCP Server CLI ### Description This section details how to execute the `@coze-arch/npm-mcp-server` binary using `npx` to start the Model Context Protocol (MCP) server. ### Usage **HTTP mode — connects on `http://localhost:3000/sse`** ```sh npx @coze-arch/npm-mcp-server@latest serve --port 3000 ``` **stdio mode — communicate over stdin/stdout** ```sh npx @coze-arch/npm-mcp-server@latest start ``` ### Cursor MCP Configuration To configure Cursor to use the server, add the following to your `settings.json` under `Model Context Protocol → servers`: ```json http://localhost:3000/sse ``` ``` -------------------------------- ### Button Disabled State Examples Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/button/index.mdx Configure the disabled state of the Button component by setting the `disabled` prop to `true`. This example shows various button colors and sizes in a disabled state. ```tsx import { Button } from '@coze-arch/coze-design'; ``` -------------------------------- ### Basic Usage Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/step.mdx Demonstrates the most basic usage of the Steps component. ```APIDOC ## Basic Usage Most basic usage of the steps bar. ```tsx import { CozSteps } from '@coze-arch/coze-design'; const Demo = () => ( ); export default Demo; ``` ``` -------------------------------- ### Small Size SegmentTab Example Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/segment-tab/index.mdx Renders a SegmentTab with the 'small' size. Use this for more compact UIs. ```tsx import { SegmentTab } from '@coze-arch/coze-design'; ``` -------------------------------- ### Component Introduction Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/segment-tab/index.mdx Demonstrates how to import the SegmentTab component from the '@coze-arch/coze-design' package. ```APIDOC ## Component Introduction Import the `SegmentTab` component from `@coze-arch/coze-design`: ```tsx import { SegmentTab } from '@coze-arch/coze-design'; ``` ``` -------------------------------- ### Run Tests Source: https://github.com/coze-dev/rush-arch/blob/main/packages/mcp/npm/README.md Execute the project's test suite. ```sh npm run test ``` -------------------------------- ### Import Avatar Component Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/stories/Introduction.mdx Import the Avatar component from the '@coze-arch/coze-design' package. Ensure this package is installed in your project. ```javascript import { Avatar } from '@coze-arch/coze-design' ``` -------------------------------- ### Navigate to Project Directory Source: https://github.com/coze-dev/rush-arch/blob/main/packages/mcp/npm/README.md Change directory into the NPM MCP server part of the monorepo. ```sh cd rush-arch/mcp/npm ``` -------------------------------- ### Default SegmentTab Example Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/segment-tab/index.mdx Renders a SegmentTab with default size and options. Use this for standard tabbed interfaces. ```tsx import { SegmentTab } from '@coze-arch/coze-design'; ``` -------------------------------- ### Rush Publish and Release CLI (Shell) Source: https://context7.com/coze-dev/rush-arch/llms.txt A three-subcommand CLI for managing the full release lifecycle: generating change files, bumping versions, creating release branches, and publishing to npm. Use '--dry-run' for testing changes before applying them. Ensure NPM_AUTH_TOKEN is set for CI publishes. ```shell # 1. Generate change files from the current commit message rush-publish change --commit-msg "feat: add new button component" # 2. Bump version and create a release branch (dry-run) rush-publish pub \ --bump-type minor \ --to @coze-arch/coze-design \ --dry-run # Publish only specific packages rush-publish pub \ --only @coze-arch/arco-icon @coze-arch/arco-illustration \ --bump-type patch \ --repo-url git@github.com:coze-dev/rush-arch.git # Publish alpha/beta directly without creating a branch rush-publish pub \ --bump-type alpha \ --from @coze-arch/coze-design \ --release # 3. Trigger actual npm publish from a release commit/tag (CI use) NPM_AUTH_TOKEN=xxx rush-publish release \ --registry https://registry.npmjs.org \ --allow-branches main release ``` -------------------------------- ### Basic Usage Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/pagination/index.mdx Demonstrates the most basic usage of the CozPagination component. ```APIDOC ## Basic Usage Most basic pagination usage. ```tsx import { CozPagination } from '@coze-arch/coze-design'; console.log(page, pageSize)} />; ``` ``` -------------------------------- ### Search and Change Callbacks Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/search.mdx Demonstrates how to handle search events with `onSearch` and input changes with `onChange`. ```tsx import { Search } from '@coze-arch/coze-design'; const Demo = () => ( console.log('搜索值:', value)} onChange={(value, e) => console.log('输入值:', value)} /> ); export default Demo; ``` -------------------------------- ### CozInputNumber Error State Example Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/input-number/index.mdx Shows how to set the CozInputNumber component to an error state using the 'error' prop. ```tsx import { CozInputNumber } from '@coze-arch/coze-design'; ; ``` -------------------------------- ### Select Component Sizes Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/select.mdx Illustrates how to use different sizes for the Select component. It supports 'default' and 'small' sizes. ```tsx import { Select } from '@coze-arch/coze-design'; const Demo = () => (

默认尺寸

); export default Demo; ``` -------------------------------- ### CozInputNumber Disabled State Example Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/input-number/index.mdx Illustrates how to disable the CozInputNumber component using the 'disabled' prop and setting an initial value. ```tsx import { CozInputNumber } from '@coze-arch/coze-design'; ; ``` -------------------------------- ### Import Input Component Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/input.mdx How to import the Input component into your project. ```tsx import { Input } from '@coze-arch/coze-design'; ``` -------------------------------- ### SVG Node Preview Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/icon/index.mdx Example of an SVG node generated by the icon component. It defaults to 'currentColor' for fill and '1em' for height and width. ```html ); }; export default Demo; ``` -------------------------------- ### Popconfirm with Custom Content Structure Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/popconfirm.mdx Demonstrates how to build richer content structures within the Popconfirm using SubTitle, Description, and Content components. ```tsx import { Popconfirm, Button } from '@coze-arch/coze-design'; const Demo = () => ( 重要提示 此操作将永久删除该文件 影响范围 删除后将无法恢复 } > ); export default Demo; ``` -------------------------------- ### Illustration Sizing Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/illustration.mdx Illustrations can have their dimensions customized using the width and height props. This example shows different sizes applied to various illustrations. ```tsx import { IconCozIllusDone, IconCozIllusAdd, IconCozIllus404, } from '@coze-arch/coze-design/illustrations'; const Demo = () => (
); export default Demo; ``` -------------------------------- ### Basic Step Usage Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/step/index.mdx Demonstrates the fundamental usage of the Steps component with different sizes and current step indication. Ensure the Steps component is imported. ```tsx import { Steps } from '@@coze-arch/coze-design'; ``` -------------------------------- ### Customizable Close Banner Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/banner/index.mdx Example of a Banner with a custom description that includes a clickable 'Don't Show Again' link, utilizing `fullMode={true}`. ```tsx import { Banner } from '@coze-arch/coze-design'; Do not share your API key with others, or expose it in the browser or other client-side. Don't Show Again ) /> ``` -------------------------------- ### Size Configuration Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/pagination/index.mdx Shows how to configure the size of the pagination component, supporting 'small' and 'default' sizes. ```APIDOC ## Size Configuration The pagination component supports `small` and `default` sizes. ```tsx import { CozPagination } from '@coze-arch/coze-design'; ``` ``` -------------------------------- ### Displaying Theme Colors in a Table Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/colors/middleground.mdx Renders a table of theme-related middleground colors using the semi-ui Table component. Ensure '@douyinfe/semi-ui' and '@coze-arch/coze-design/colors' are installed. ```javascript import { Table } from '@douyinfe/semi-ui'; import { mgColumns, mgThemes, } from '@coze-arch/coze-design/colors'; ``` -------------------------------- ### Load Rush monorepo configuration Source: https://context7.com/coze-dev/rush-arch/llms.txt Lazily loads and caches the Rush configuration from the nearest `rush.json` file. Can optionally start searching from a specified directory. ```typescript import { getRushConfiguration } from '@coze-arch/monorepo-kits'; const config = getRushConfiguration(); // auto-detects rush.json from cwd console.log(config.rushJsonFolder); // '/path/to/repo' console.log(config.projects.length); // number of projects in rush.json // With explicit starting folder const config2 = getRushConfiguration('/path/to/sub/folder'); ``` -------------------------------- ### Import Search Component Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/search.mdx How to import the Search component into your project. ```tsx import { Search } from '@coze-arch/coze-design'; ``` -------------------------------- ### Badge Number Overflow Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/badge.mdx When the `count` exceeds the `overflowCount` (defaulting to 99), the badge will display as `${overflowCount}+`. This example shows a count of 1000 with an `overflowCount` of 999. ```tsx import { CozAvatar, Badge } from '@coze-arch/coze-design'; const Demo = () => (
BD BD BD
); export default Demo; ``` -------------------------------- ### searchNpmPackages Tool Source: https://context7.com/coze-dev/rush-arch/llms.txt Utilize the `searchNpmPackages` tool to query the npm registry with various filtering and pagination options. ```APIDOC ## `searchNpmPackages` — MCP tool (`packages/mcp/npm/src/mcp/search.ts`) ### Description Searches the npm registry (or a custom mirror) using the npm v1 search API. This tool accepts quality, popularity, and maintenance score thresholds as filters and supports pagination via `size` and `from` parameters. It returns an array of package objects, each containing details like name, version, description, author, keywords, and score breakdown. ### Usage ```ts import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js'; const transport = new SSEClientTransport(new URL('http://localhost:3000/sse')); const client = new Client({ name: 'my-client', version: '1.0.0' }, { capabilities: { tools: {} }, }); await client.connect(transport); const result = await client.callTool({ name: 'searchNpmPackages', arguments: { keyword: 'state management', size: 5, from: 0, quality: 0.65, // 0–1, default 0.65 popularity: 0.98, // 0–1, default 0.98 maintenance: 0.5, // 0–1, default 0.5 registry: 'https://registry.npmjs.org', // or 'https://registry.npmmirror.com' }, }); const packages = JSON.parse(result.content[0].text); // Example response structure: // [ // { // package: { name: 'redux', version: '5.0.1', description: '...', ... }, // score: { final: 0.92, detail: { popularity: 0.98, quality: 0.87, maintenance: 0.91 } }, // searchScore: 100000.321 // }, ... // ] await client.close(); ``` ``` -------------------------------- ### Basic Step Usage Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/step.mdx Demonstrates the most basic usage of the CozSteps component with three steps, showing completed, in-progress, and pending states. ```tsx import { CozSteps } from '@coze-arch/coze-design'; const Demo = () => ( ); export default Demo; ``` -------------------------------- ### Avatar Event Handling Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/avatar.mdx Illustrates how to attach event handlers like `onClick`, `onMouseEnter`, and `onMouseLeave` to the CozAvatar component, including examples with and without the `hoverMask`. ```tsx import { CozAvatar } from '@coze-arch/coze-design'; const Demo = () => { return (
console.log('Avatar clicked')} onMouseEnter={() => console.log('Mouse entered')} onMouseLeave={() => console.log('Mouse left')} hoverMask > E console.log('Image avatar clicked')} hoverMask />
); }; export default Demo; ``` -------------------------------- ### Render COZLoading with Different Sizes Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/loading/index.mdx Demonstrates how to use the Loading component with predefined size variants: mini, small, middle, and large. ```tsx import { Loading } from '@coze-arch/coze-design'; ``` -------------------------------- ### Run NPM MCP Server Locally in Terminal Mode Source: https://github.com/coze-dev/rush-arch/blob/main/README.md For local development, this command starts the NPM MCP Server in terminal mode from the 'mcp/npm' directory. ```sh cd mcp/npm npm run start ``` -------------------------------- ### Build the Project Source: https://github.com/coze-dev/rush-arch/blob/main/packages/mcp/npm/README.md Compile the TypeScript code into JavaScript. ```sh npm run build ``` -------------------------------- ### Render COZLoading with Custom Labels and Label Sizes Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/loading/index.mdx Illustrates how to customize the loading tip text and its size using the 'label' and 'labelSize' props. ```tsx import { Loading } from '@coze-arch/coze-design'; ``` -------------------------------- ### Basic Modal and Dialog Usage Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/modal.mdx Demonstrates the basic usage of both 'modal' and 'dialog' types. Use this to display important information or prompt user actions. ```tsx import { Modal, Button } from '@coze-arch/coze-design'; import { useState } from 'react'; const Demo = () => { const [visible, setVisible] = useState({ modal: false, dialog: false }); return ( <> setVisible({ ...visible, modal: false }) } onCancel={() => setVisible({ ...visible, modal: false }) } cancelText="取消" okText="删除"> 此操作无法撤销 setVisible({ ...visible, dialog: false }) } onCancel={() => setVisible({ ...visible, dialog: false }) } cancelText="取消" okText="删除"> 此操作无法撤销 ); }; export default Demo; ``` -------------------------------- ### Banner Types Example Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/banner/index.mdx Demonstrates the four preset types for the Banner component: info, success, warning, and danger. Each type corresponds to a different color scheme. ```tsx import { Banner } from '@coze-arch/coze-design'; ``` -------------------------------- ### Basic Layout Usage Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/layout.mdx Demonstrates the most basic usage of the Layout component with Header, Content, and Footer. ```tsx import { Layout } from '@coze-arch/coze-design'; const Demo = () => { return (
内容区域
页脚内容
); }; export default Demo; ``` -------------------------------- ### Typography Component Types Example Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/typography/index.mdx Demonstrates the usage of different typography types: Title, Text, Paragraph, and Numeral. The Numeral component supports precision for displaying numbers. ```tsx import { Typography } from '@coze-arch/coze-design'; const { Title, Text, Paragraph, Numeral } = Typography; 标题Title 文字Text 段落Paragraph 数字Numeral:1.6111e1 K ``` -------------------------------- ### Radio Group with Horizontal and Vertical Layout Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/radio.mdx Utilize Radio.Group to manage a set of mutually exclusive radio buttons. This example shows how to configure horizontal and vertical layouts, and a disabled group. ```tsx import { Radio } from '@coze-arch/coze-design'; const Demo = () => (

水平排列

选项A 选项B 选项C

垂直排列

选项A 选项B 选项C

禁用状态

选项A 选项B 选项C
); export default Demo; ``` -------------------------------- ### Basic Loading Usage Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/loading.mdx Demonstrates the most basic usage of the Loading component. Set `loading=true` to display the loading state. ```tsx import { Loading } from '@coze-arch/coze-design'; const Demo = () => { return (
); }; export default Demo; ``` -------------------------------- ### TabBar with 'text' type and left alignment Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/tab-bar/index.mdx Illustrates the 'text' type for TabBar, which uses text-based styling similar to semi-design's 'line' property. This example also sets the alignment to 'left'. ```tsx import { TabBar } from '@coze-arch/coze-design'; const { TabPanel } = TabBar; 我的 插件 工作流 图像流 知识库 卡片 ``` -------------------------------- ### Loading Sizes Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/loading/index.mdx The Loading component supports four preset sizes: `mini`, `small`, `middle`, and `large`. Each size is suitable for different contexts. ```APIDOC ## Sizes - **mini**: `size: 14px`, typically used inside components like buttons and inputs. - **small**: `size: 20px`, default size for general loading indications. - **middle**: `size: 24px`, for scenarios requiring a more prominent loading indicator. - **large**: `size: 32px`, used for masks or floating content overlays. ### Example ```tsx import { Loading } from '@coze-arch/coze-design'; ``` ``` -------------------------------- ### Button onClick Event Handling Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/button/index.mdx Handle standard click events using the `onClick` prop, which corresponds to standard HTML events. This example demonstrates toggling a state based on button clicks. ```tsx import { Button } from '@coze-arch/coze-design'; import { useState } from 'react'; const [isOpen, setIsOpen] = useState(false); const handlePress = () => { setIsOpen(prev => !prev); }; return (
state: {isOpen ? 'close' : 'open'}
); ``` -------------------------------- ### Basic Pagination Usage Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/pagination.mdx Demonstrates the most basic implementation of the Pagination component. Ensure to provide the total number of items, current page, and page size. The onChange callback is triggered when the page or page size changes. ```tsx import { CozPagination } from '@coze-arch/coze-design'; const Demo = () => ( console.log(page, pageSize)} /> ); export default Demo; ``` -------------------------------- ### Select Component with Chip Rendering Modes Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/select.mdx Demonstrates the Select component's chip rendering modes: 'selectedItem' for displaying selected options as chips and 'trigger' for displaying chips in the input area. Includes single and multi-select examples. ```tsx import { Select } from '@coze-arch/coze-design'; const Demo = () => { const options = [ 'brand', 'primary', 'green', 'yellow', 'red', 'cyan', 'blue', 'purple', 'magenta', ].map(color => ({ label: color, value: color, chipColor: color, })); return (

单选 - selectedItem 模式

trigger 模式

; }; export default Demo; ``` -------------------------------- ### Configure NPM MCP Server in Cursor IDE Source: https://github.com/coze-dev/rush-arch/blob/main/packages/mcp/npm/README.md Add this URL to your Cursor IDE settings under 'Model Context Protocol' to enable communication with the NPM MCP server. ```json { "mcpServers": { "npm-mcp": { "type": "http", "url": "http://localhost:3000/sse" } } } ```