+ <Text link icon={<IconLink />} underline>Link</Text>
+ </div>
+ );
}
```
@@ -130,20 +130,20 @@ import React from 'react';
import { Typography } from '@douyinfe/semi-ui';
function Demo() {
- const { Paragraph, Title } = Typography;
- return (
- <div>
- <Title heading={5}>Default Spacing</Title>
- <Paragraph>
- Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.
- </Paragraph>
- <br />
- <Title heading={5}>Extended Spacing</Title>
- <Paragraph spacing="extended">
- Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.
- </Paragraph>
- </div>
- );
+ const { Paragraph, Title } = Typography;
+ return (
+ <div>
+ <Title heading={5}>Default Spacing</Title>
+ <Paragraph>
+ {`Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.`}
+ </Paragraph>
+ <br />
+ <Title heading={5}>Extended Spacing</Title>
+ <Paragraph spacing="extended">
+ {`Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.`}
+ </Paragraph>
+ </div>
+ );
}
```
@@ -156,20 +156,20 @@ import React from 'react';
import { Typography } from '@douyinfe/semi-ui';
function Demo() {
- const { Paragraph, Text } = Typography;
- return (
- <div>
- <Text>Normal</Text>
- <Paragraph spacing="extended">
- Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.
- </Paragraph>
- <br />
- <Text size='small'>Small</Text>
- <Paragraph size='small'>
- Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.
- </Paragraph>
- </div>
- );
+ const { Paragraph, Text } = Typography;
+ return (
+ <div>
+ <Text>Normal</Text>
+ <Paragraph spacing="extended">
+ {`Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.`}
+ </Paragraph>
+ <br />
+ <Text size='small'>Small</Text>
+ <Paragraph size='small'>
+ {`Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.`}
+ </Paragraph>
+ </div>
+ );
}
```
@@ -179,22 +179,22 @@ Copyable text.
```jsx live=true
import React from 'react';
-import { Typography } from '@douyinfe/semi-ui';
+import { Typography, TextArea } from '@douyinfe/semi-ui';
function Demo() {
- const { Paragraph, Text } = Typography;
-
- return (
- <div>
- <Paragraph copyable>Click the right icon to copy text.</Paragraph>
- With suffix: Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.
- Multi-line ellipsis: Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.
- With Popover: Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.
- Expandable and collapsible: Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.
+ {`With suffix: Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.`}
+ {`Multi-line ellipsis: Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.`}
+ {`With Popover: Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.`}
+ {`Expandable and collapsible: Life's but a walking shadow, a poor player, that struts and frets his hour upon the stage, and then is heard no more; it is a tale told by an idiot, full of sound and fury, signifying nothing.`}
- description={<div>You can contact the corresponding R & D students to confirm whether you have applied for an application on <Text link={{ href: 'https://semi.design/' }}>the application cloud platform</Text> , and fill in the corresponding information.</div>}
- description={<div>You can contact the corresponding R & D students to confirm whether you have applied for an application on <Text link={{ href: 'https://semi.design/' }}>the application cloud platform</Text> , and fill in the corresponding information.</div>}
- description={<div>You can contact the corresponding R & D students to confirm whether you have applied for an application on <Text link={{ href: 'https://semi.design/' }}>the application cloud platform</Text> , and fill in the corresponding information.</div>}
- description={<div>You can contact the corresponding R & D students to confirm whether you have applied for an application on <Text link={{ href: 'https://semi.design/' }}>the application cloud platform</Text> , and fill in the corresponding information.</div>}
+ description={<div>You can contact the corresponding R & D students to confirm whether you have applied for an application on <Text link={{ href: 'https://semi.design/' }}>the application cloud platform</Text> , and fill in the corresponding information.</div>}
+ description={<div>You can contact the corresponding R & D students to confirm whether you have applied for an application on <Text link={{ href: 'https://semi.design/' }}>the application cloud platform</Text> , and fill in the corresponding information.</div>}
+ description={<div>You can contact the corresponding R & D students to confirm whether you have applied for an application on <Text link={{ href: 'https://semi.design/' }}>the application cloud platform</Text> , and fill in the corresponding information.</div>}
+ description={<div>You can contact the corresponding R & D students to confirm whether you have applied for an application on <Text link={{ href: 'https://semi.design/' }}>the application cloud platform</Text> , and fill in the corresponding information.</div>}
- description="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"
- description="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"
@@ -125,38 +125,38 @@ import { CheckboxGroup } from '@douyinfe/semi-ui';
class App extends React.Component {
- render() {
- function onChange(checkedValues) {
- console.log('checked = ', checkedValues);
+ render() {
+ function onChange(checkedValues) {
+ console.log('checked = ', checkedValues);
+ }
+
+ const plainOptions = ['semi', 'vigo', 'helo'];
+ const options = [
+ { label: 'Aim for the highest', value: '1', extra: "Raise the bar. Wait for bigger gains. Find the best solutions by widening your perspective. Be attentive. Distill ideas down to their fundamental truths. Keep learning and growing" },
+ { label: 'Be grounded & courageous', value: '2', extra:"Make your own discoveries. Dive deep into facts. Stay level-headed. Focus on impact. Assume ownership, take risks, break the mold. Rapid iterations, multiple possibilities." },
+ { label: 'Be open & humble', value: '3', extra: "Trust yourself, trust each other. Be willing to offer and ask for help. Collaboration creates value. Approach problems with the big picture in mind. Be mindful and check your ego; stay open to different ideas." },
+ { label: 'Be candid & clear', value: '4', extra: "Dare to share your honest opinions. It's okay to make mistakes. Own it when you do. Stick to the facts, identify issues, and avoid \'leader-pleasing.\' Be accurate and forthright; be methodical and focused."}
- { label: 'Aim for the highest', value: '1', extra: "Raise the bar. Wait for bigger gains. Find the best solutions by widening your perspective. Be attentive. Distill ideas down to their fundamental truths. Keep learning and growing" },
- { label: 'Be grounded & courageous', value: '2', extra:"Make your own discoveries. Dive deep into facts. Stay level-headed. Focus on impact. Assume ownership, take risks, break the mold. Rapid iterations, multiple possibilities." },
- { label: 'Be open & humble', value: '3', extra: "Trust yourself, trust each other. Be willing to offer and ask for help. Collaboration creates value. Approach problems with the big picture in mind. Be mindful and check your ego; stay open to different ideas." },
- { label: 'Be candid & clear', value: '4', extra: "Dare to share your honest opinions. It's okay to make mistakes. Own it when you do. Stick to the facts, identify issues, and avoid \'leader-pleasing.\' Be accurate and forthright; be methodical and focused."}
@@ -365,16 +366,19 @@ import { Anchor } from '@douyinfe/semi-ui';
- No, it means there is a problem with the id. check whether the id exists in the document;
- Yes, it may be that the scrolling container is not set correctly to ensure that the content of the document is wrapped in the scrolling container. The default scrolling container is window. If your container is a div of .my-container, you should set the scrolling container to this div.
import { Card, Typography } from '@douyinfe/semi-ui';
function Demo() {
- const { Text } = Typography;
+ const { Text } = Typography;
- return (
- <Card
- title='Semi Design'
- style={{ maxWidth: 360 }}
- headerExtraContent={
- <Text link>
- More
- </Text>
- }
- >
- Semi Design is a design system developed and maintained by IES-FE & IES-UED. The design system includes a design language and a set of reusable front-end components, helping designers and developers to more easily create high-quality, consistent user experience, design-compliant Web applications.
- </Card>
- );
+ return (
+ <Card
+ title='Semi Design'
+ style={{ maxWidth: 360 }}
+ headerExtraContent={
+ <Text link>
+ More
+ </Text>
+ }
+ >
+ Semi Design is a design system developed and maintained by IES-FE & IES-UED. The design system includes a design language and a set of reusable front-end components, helping designers and developers to more easily create high-quality, consistent user experience, design-compliant Web applications.
- Semi Design is a design system developed and maintained by IES-FE & IES-UED. The design system includes a design language and a set of reusable front-end components, helping designers and developers to more easily create high-quality, consistent user experience, design-compliant Web applications.
- </Card>
- </div>
- );
+ return (
+ <div
+ style={{
+ display: 'inline-block',
+ padding: 20,
+ backgroundColor: 'var(--semi-color-fill-0)'
+ }}
+ >
+ <Card
+ style={{ maxWidth: 360 }}
+ bordered={false}
+ headerLine={true}
+ title='Semi Design'
+ >
+ Semi Design is a design system developed and maintained by IES-FE & IES-UED. The design system includes a design language and a set of reusable front-end components, helping designers and developers to more easily create high-quality, consistent user experience, design-compliant Web applications.
@@ -163,17 +163,22 @@ import { IconCopy } from '@douyinfe/semi-icons';
You can prevent the event from bubbling to Collapse.Header in the onClick event callback of the custom element. If the custom element does not provide an event object, wrap a layer of div to prevent bubbling in the div onClick.
- <p style={{lineHeight: 1.8}}>Semi Design is a design system developed and maintained by IES Front-end Team and UED Team</p>
- <p style={{lineHeight: 1.8}}>Semi Design create a consistent, good-looking, easy-to-use, and efficient user experience with a user-centric, content-first, and human-friendly design system.
+ <p style={{lineHeight: 1.8}}>Semi Design is a design system developed and maintained by IES Front-end Team and UED Team</p>
+ <p style={{lineHeight: 1.8}}>Semi Design create a consistent, good-looking, easy-to-use, and efficient user experience with a user-centric, content-first, and human-friendly design system.
+ </p>
+ <ul>
+ <li><p>Content-first</p></li>
+ <li><p>Customized theming</p></li>
+ <li><p>Internationalized</p></li>
+ <li><p>Humanism</p></li>
+ </ul>
+ </Modal>
+ </>
+ );
+ }
}
```
@@ -353,90 +353,90 @@ import { Modal, Button, List } from '@douyinfe/semi-ui';
import { IconVigoLogo, IconSemiLogo } from '@douyinfe/semi-icons';
@@ -2920,11 +2920,11 @@ class App extends React.Component {
let pagination = checked
? false
: {
- currentPage: 1,
- pageSize: 8,
- total: data.length,
- onPageChange: page => this.setPage(page),
- };
+ currentPage: 1,
+ pageSize: 8,
+ total: data.length,
+ onPageChange: page => this.setPage(page),
+ };
this.setState({ pagination });
};
@@ -3665,28 +3665,33 @@ function App() {
> Also in `column.onCell` `column.onHeaderCell` Properties or events supported by td / th can also be returned.
```jsx noInline=true
-<Table
- onRow={(record, index) => {
- return {
- onClick: event => {},
- onMouseEnter: event => {},
- onMouseLeave: event => {},
- className: '',
+import React from 'react';
+import { Table } from '@douyinfe/semi-ui';
+
+() => (
+ <Table
+ onRow={(record, index) => {
+ return {
+ onClick: event => {},
+ onMouseEnter: event => {},
+ onMouseLeave: event => {},
+ className: '',
// ...
// Other attributes or events that can be applied to tr
- };
- }}
- onHeaderRow={(columns, index) => {
- return {
- onClick: event => {},
- onMouseEnter: event => {},
- onMouseLeave: event => {},
- className: '',
+ };
+ }}
+ onHeaderRow={(columns, index) => {
+ return {
+ onClick: event => {},
+ onMouseEnter: event => {},
+ onMouseLeave: event => {},
+ className: '',
// ...
// Other attributes or events that can be applied to th
- };
- }}
-/>
+ };
+ }}
+ />
+);
```
## Column
@@ -3826,9 +3831,10 @@ function Demo() {
## FAQ
- **Why is the table data not updated?**
At present, all parameters of the table component are shallow comparison. That is to say, if the parameter value type is an array or object, you need to manually change its reference to trigger the update. Similarly, if you don't want to trigger additional updates, try not to use literal values when passing parameters directly or define reference parameter values in the render process:
The above writing method will trigger the update of data in the table every time render (the current selected row will be cleared and the row key array will be expanded, etc.). In order to improve performance and avoid some exceptions, please define some reference type parameters outside the render method as far as possible (if hooks are used, please use useMemo or useState for storage).**