===============
LIBRARY RULES
===============
From library maintainers:
- Use named imports: import { Button, Card } from '@wix/design-system'
- Icons are separate: import { Edit } from '@wix/wix-ui-icons-common'
- Check *Props.md for prop types and available example IDs
- Check *Examples.md for implementation patterns
- Prefer WDS layout primitives (Box, Card, Layout, Cell) over custom containers
### Wix Page Component Examples
Source: https://context7.com/vltansky/wix-design-system-docs/llms.txt
Illustrates the usage of the Wix Page component for structuring application layouts. Examples include basic page setup, adding action buttons to the header, utilizing background images, implementing sticky toolbars for tables, and incorporating a tail element for persistent information.
```jsx
import { Page, Card, Button, Table, TableToolbar, Layout, Cell, Text } from '@wix/design-system';
// Basic page structure
Page content goes here
// Page with action buttons
}
/>
{/* Content */}
// Page with background image
{/* Content */}
// Page with sticky toolbar (for infinite scroll tables)
{orders.length} orders
// Page with tail element
Summary metrics that stay visible on scroll
{/* Charts and detailed content */}
```
--------------------------------
### Dropdown Component Examples
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/DropdownExamples.md
Examples demonstrating the usage of the Dropdown component with different props.
```APIDOC
## Dropdown Component Features
### Size
#### Description
Adjust the component size using the `size` prop.
- `large`: Emphasize fields in onboarding flows.
- `medium`: The default size used in most cases.
- `small`: Should be used in dense layouts.
### Border
#### Description
Style the component using the `border` prop which supports four styles:
- `standard`: For forms.
- `round`: When the component is used to filter.
- `bottomLine`: For titles that can be edited on click.
- `none`: In the Content Manager’s spreadsheet.
### Status
#### Description
Use the `status` prop to control component status.
- `error`: Highlights an invalid selection.
- `warning`: Highlights a value that can’t be validated or impacts a user’s business.
- `loading`: Shows that the value is loading.
Hide the status suffix and indicate the state with a border color by setting `hideStatusSuffix` to true.
### Status Message
#### Description
Add text that explains the status or what action the user should take with the `statusMessage` prop.
Showing the status message inline, directly below the dropdown is preferred in all default cases.
- To add an accessible inline message, wrap the component in a `` and add the `statusMessage`.
- To add a status message in a tooltip that requires users to hover on the icon, use the `statusMessage` prop. Control tooltip placement with `tooltipPlacement` prop.
### Disabled
#### Description
Disable all input interactions with the `disabled` prop. Use it to highlight unavailable functions.
```
--------------------------------
### Image Gallery Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/MediaOverlayExamples.md
Example of using Media Overlay for image galleries to display static data like counters.
```APIDOC
## Image Gallery Example
### Description
Use media overlay to place static data on top of an image, e.g. to place a counter indicating how many more images there are.
### Method
N/A
### Endpoint
N/A
### Parameters
N/A
### Request Example
```jsx
{/* Image gallery specific content */}
```
### Response
N/A
```
--------------------------------
### Product List Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/ImageExamples.md
This example demonstrates how to create a product list table using Wix Design System components. It includes product images, names, SKUs, stock availability, prices, and action buttons.
```APIDOC
## Product List Component
### Description
This component displays a list of products with their thumbnails, names, SKUs, stock status, prices, and actions. It utilizes various components from the Wix Design System for a consistent UI.
### Method
N/A (Component Example)
### Endpoint
N/A (Component Example)
### Parameters
N/A (Component Example)
### Request Example
N/A (Component Example)
### Response
N/A (Component Example)
### Code Example
```jsx
() => {
const records = [
{
name: 'Hoodie',
sku: 25232564,
inStock: true,
price: '$14.00',
image: ,
},
{
name: 'Watch',
sku: 35246432,
inStock: true,
price: '$29.00',
image: ,
},
{
name: 'Glasses',
sku: 4864310,
inStock: false,
price: '$69.00',
image: ,
},
{
name: 'Leather shoes',
sku: 125156422,
inStock: true,
price: '$7.00',
image: ,
},
];
const Status = ({ isInStock }) => (
{isInStock ? 'In Stock' : 'Out Of Stock'}
);
const secondaryAction = [
{
icon: ,
text: 'Duplicate',
onClick: () => {},
},
{
icon: ,
text: 'Delete',
onClick: () => {},
},
];
const columns = [
{
title: '',
render: row => row.image,
width: '60px',
},
{
title: 'Name',
render: row => row.name,
width: '30%',
},
{
title: 'SKU',
render: row => row.sku,
width: '20%',
align: 'start',
},
{
title: 'Stock',
render: row => ,
width: '20%',
align: 'start',
},
{
title: 'Price',
render: row => row.price,
width: '10%',
align: 'start',
},
{
render: row => ,
width: '10%',
},
];
return (
Products
);
};
```
```
--------------------------------
### Setup Sidebar Selection Management
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/SidebarItemNextExamples.md
Provides an example of controlling item selection within a Sidebar component by managing the 'selectedKey' state. It also demonstrates truncating child item text with the 'isInQuickNavigation' prop.
```jsx
() => {
const [selectedKey, setSelectedKey] = React.useState('1-1');
return (
setSelectedKey('1-1')}
>
{
setSelectedKey('1-1');
}}
>
Child item that's setup incorrectly, it allows text wrapping{' '}
setSelectedKey('1-2')}
isInQuickNavigation
>
Child item using isInQuickNavigation property preveting from text
being wrapped
);
}
```
--------------------------------
### Item Lists Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/MediaOverlayExamples.md
Example of using Media Overlay for item lists, such as dishes, that can be interacted with.
```APIDOC
## Item Lists Example
### Description
Use media overlay to list down visual items, such as dishes, that can be edited, marked as favourite or interacted with in any other way.
### Method
N/A
### Endpoint
N/A
### Parameters
N/A
### Request Example
```jsx
{/* Item list specific content */}
```
### Response
N/A
```
--------------------------------
### Reorderable List Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/MediaOverlayExamples.md
Example of using Media Overlay with middle placement and a Drag Handle for reorderable lists.
```APIDOC
## Reorderable List Example
### Description
Use middle placement at the center to position recordable element indication. This function should use a compound `` component.
### Method
N/A
### Endpoint
N/A
### Parameters
N/A
### Request Example
```jsx
{/* Reorderable list content */}
```
### Response
N/A
```
--------------------------------
### Marketing Layout Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/CardExamples.md
Demonstrates the usage of the MarketingLayout component, which should always be wrapped within a Card. This example includes title, description, actions, size, badge, and image props, utilizing Card, MarketingLayout, Button, Badge, Box, and Image components.
```jsx
Start Now}
size="tiny"
badge={Essential}
image={
}
/>
;
```
--------------------------------
### Multi-step Form Flow Example (React)
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/StepperExamples.md
Demonstrates a multi-step form flow using the Stepper component to guide users through a process. Supports linear and nonlinear navigation logic, with options to disable future or past steps.
```jsx
() => {
const [activeStep, setActiveStep] = React.useState(0);
return (
setActiveStep(step)}
steps={[
{ text: 'Brand your program' },
{ text: 'Set points' },
{ text: 'Set rewards', type: 'disabled' },
{ text: 'Add description', type: 'disabled' },
]}
/>
Add Item
);
}
```
--------------------------------
### WDS Button Component Examples
Source: https://context7.com/vltansky/wix-design-system-docs/llms.txt
Demonstrates various configurations of the Wix Design System Button component. Includes examples for different sizes, skins, priorities, icons, full-width, disabled states, and anchor links. Requires '@wix/design-system' and '@wix/wix-ui-icons-common'.
```jsx
import { Button } from '@wix/design-system';
import { Add, ChevronDown } from '@wix/wix-ui-icons-common';
// Basic button variations
// Button skins and priorities
// Buttons with icons
}>Add Item
}>Show Menu
// Full width and disabled states
// Button as anchor link
```
--------------------------------
### Social Media Gallery Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/MediaOverlayExamples.md
Example of using Media Overlay for social media galleries to display identifying data.
```APIDOC
## Social Media Gallery Example
### Description
Use media overlay to place identifying data, such as logo or video duration on top of a media item.
### Method
N/A
### Endpoint
N/A
### Parameters
N/A
### Request Example
```jsx
{/* Social media specific content */}
```
### Response
N/A
```
--------------------------------
### Settings Panel Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/RadioGroupExamples.md
Demonstrates using small radio buttons within a settings panel for UI consistency.
```APIDOC
## Settings Panel Example
### Description
Only use small size radio buttons in settings panels to ensure consistency across all panels.
### Method
N/A (Component Usage)
### Endpoint
N/A (Component Usage)
### Parameters
#### Component Props
- **size** (string) - Optional - Sets the size of the radio buttons to 'small'.
- **value** (any) - Required - The currently selected value.
- **onChange** (function) - Required - Callback function when the selection changes.
### Request Example
```jsx
() => {
const [defaultStateselected, setDefaultStateSelected] = React.useState(1);
const [homepageTypeSelected, setHomepageTypeSelected] = React.useState(1);
return (
Full trailHide homepageHide current pageTextIcon
);
}
```
### Response
N/A (Component Usage)
### Response Example
N/A (Component Usage)
```
--------------------------------
### Checkout Form Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/InputWithLabelExamples.md
An example demonstrating the use of inputs with labels specifically for building a Premium Checkout form.
```APIDOC
## Checkout Form Example
### Description
This input with labels can only be used to build a Premium Checkout form.
### Method
Not Applicable (Component Usage Example)
### Endpoint
Not Applicable (Component Usage Example)
### Parameters
Not Applicable (Component Usage Example)
### Request Example
```jsx
// Example for Premium Checkout form structure
```
### Response
Not Applicable (Component Usage Example)
### Response Example
Not Applicable (Component Usage Example)
```
--------------------------------
### Basic Modal Implementation
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/AnnouncementModalLayoutProps.md
An example demonstrating how to implement a basic Modal component using the provided API properties.
```jsx
console.log("Saved")}
secondaryButtonText="Cancel"
secondaryButtonOnClick={() => console.log("Cancelled")}
/>
```
--------------------------------
### Side Panel Custom Footer Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/SidePanelExamples.md
Shows how to implement custom footers for Side Panels to display confirmation or close actions. Includes examples with a placeholder, a single close button, and multiple action buttons.
```jsx
```
--------------------------------
### Wix Side Panel Structure Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/SidePanelExamples.md
Demonstrates the basic structure of a Side Panel, composed of optional Header, Content, Divider, and Footer components. This example shows a typical usage with a header and content.
```jsx
{}}>
Content
Footer
;
```
--------------------------------
### InputArea: Form Integration Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/InputAreaExamples.md
Shows how to integrate the InputArea component within a form layout using other Wix Design System components like FormField, Input, Layout, and Cell. This example demonstrates a common use case for multi-line text input in forms.
```jsx
() => {
const [visibleChecked, setVisibleChecked] = React.useState(true);
const [nameInputValue, setNameInputValue] = React.useState('My New Menu');
const [value, setValue] = React.useState('');
return (
{}}
title="Create new menu"
>
setNameInputValue(e.target.value)}
/>
setValue(e.target.value)}
/>
setVisibleChecked(!visibleChecked)}
/>
);
}
```
--------------------------------
### Layout and Box Component Examples
Source: https://context7.com/vltansky/wix-design-system-docs/llms.txt
Showcases the Layout component for creating grid-based structures and the Box component for flexible container styling, spacing, and alignment. Includes examples for basic grids, responsive columns, and flexbox layouts.
```jsx
import { Layout, Cell, Box, Card, Text, Button } from '@wix/design-system';
// Basic grid layout
Left columnRight column
// Responsive columns
Column 1Column 2Column 3
// Layout with gap
// Box for flexbox layouts
// Box with vertical alignment
TitleDescription text
// Box for centering content
Centered content
// Box with background and border
Styled container
```
--------------------------------
### Default Selection Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/RadioGroupExamples.md
Illustrates how to set a default selected option, preferably a neutral choice.
```APIDOC
## Default Selection Example
### Description
Have a default option selected whenever possible, ideally a neutral choice such as "None" or "All".
### Method
N/A (Component Usage)
### Endpoint
N/A (Component Usage)
### Parameters
#### Component Props
- **value** (any) - Required - The currently selected value, initialized to the default option.
- **onChange** (function) - Required - Callback function when the selection changes.
### Request Example
```jsx
() => {
const [selected, setSelected] = React.useState(1);
return (
AllIn stockOut of stock
);
}
```
### Response
N/A (Component Usage)
### Response Example
N/A (Component Usage)
```
--------------------------------
### Widget Card Layout Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/CardExamples.md
Shows how to use Card components as widgets within grids or custom layouts. The `showShadow` property can be used to highlight a card, and these cards typically do not include headers. This example uses Layout, Cell, Box, Badge, Heading, and Button components.
```jsx
() => {
const CustomCard = ({ title, suggested = false }) => {
const [hovered, setHovered] = React.useState(false);
return (
setHovered(true)}
onMouseLeave={() => setHovered(false)}
>
{suggested && (
SUGGESTED FOR YOU
)}
{title}
);
};
return (
);
};
```
--------------------------------
### Common Use Case: No data on a page
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/EmptyStateExamples.md
Use the 'page' or 'page-no-border' skin for empty states on a page to inform users about what content will appear and guide them on how to get started.
```APIDOC
## Common Use Case: No data on a page
### Description
Use the `page` or `page-no-border` skin to tell users what will appear on the page once there’s data to display, and if relevant, what they can do to get started.
### Request Example
```jsx
}>Add Task}
/>
}
title="Add your first task"
subtitle="Manage tasks and reminders for your site to get more done."
>
{}>Add Task}
```
```
--------------------------------
### Implement App Introduction with Wix SidePanel and EmptyState
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/EmptyStateExamples.md
This snippet shows how to use the SidePanel and EmptyState components to create an app introduction. It includes an app icon, description, and primary actions to guide users. The SidePanel provides navigation via VerticalTabs, and the EmptyState is configured with a theme, skin, title, subtitle, and action buttons.
```jsx
{}}>
MainDisplayLayoutDesignSupport
}
title="Blog feed"
subtitle="Customize the layout and design of your blog feed, or create a post."
>
```
--------------------------------
### Implement progress bar in setup cards
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/CircularProgressBarExamples.md
Example of using the CircularProgressBar within a Card component to indicate progress in a setup process or checklist.
```jsx
SEO setup checklist
Fix current issues and follow recommendations to improve this site’s
performance in search results.
;
```
--------------------------------
### Empty State Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/CardExamples.md
Illustrates how to use the EmptyState component to guide users when there is no content to display. This example includes a Card with a header and content, featuring an EmptyState component with title, subtitle, theme, and a TextButton for a call to action. It uses Card, Button, Icons, EmptyState, and TextButton components.
```jsx
}>
Add Product
}
/>
}>
Add Product
;
```
--------------------------------
### Wix Modal Structure Example
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/ModalExamples.md
Demonstrates the basic structure of a Wix Modal, showing how to open and close it with custom content. It utilizes React state management for modal visibility and includes a placeholder for modal content.
```jsx
() => {
const [isModalOpened, setModalOpened] = React.useState(false);
const openModal = () => setModalOpened(true);
const closeModal = () => setModalOpened(false);
const renderModalContent = () => (
Modal content goes here.
Close Modal
);
return (
}>
Open Modal
{renderModalContent()}
);
};
```
--------------------------------
### Enter Animation Examples
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/TransitionExamples.md
Demonstrates the usage of different enter animations: Fade In, Move In, Expand, and ScaleUp. Each animation can be controlled with properties like direction, distance, duration, and easing.
```APIDOC
## Enter Animation
### Description
This section showcases how to implement various enter animations for components, providing a dynamic and engaging user experience. The available animations are:
* **Fade In**: Ideal for sudden appearances or state changes.
* **Move In**: Emphasizes the direction of appearance, supporting four directional options.
* **Expand**: Suitable for objects appearing within content, supporting four directional options.
* **ScaleUp**: Used to indicate an object appearing from a specific point, supporting nine directional options.
Refer to the API for all possible direction options.
### Method
N/A (Component usage example)
### Endpoint
N/A (Component usage example)
### Parameters
N/A (Component usage example)
### Request Example
```jsx
() => {
const [showFade, setShowFade] = React.useState(false)
const [showMove, setShowMove] = React.useState(false)
const [showExpand, setShowExpand] = React.useState(false)
const [showScaleUp, setShowScaleUp] = React.useState(false)
return (
fadeIn
moveIn
expand
scaleUp
)
}
```
### Response
N/A (Component usage example)
### Response Example
N/A (Component usage example)
```
--------------------------------
### Wix Card Component Examples
Source: https://context7.com/vltansky/wix-design-system-docs/llms.txt
Demonstrates various ways to use the Wix Card component, including basic structure, adding headers with actions, using section headers, incorporating close buttons, and creating multi-content sections within a card.
```jsx
import { Card, SectionHeader, Box, Layout, Cell, TextButton, CloseButton, Text } from '@wix/design-system';
// Basic card structure
Card content goes here
// Card with header suffix action
View All}
/>
{/* Content */}
// Card with section headers
Edit}
/>
{/* General settings content */}
{/* Advanced settings content */}
// Card with close button
}>
This card can be dismissed
// Card with multiple content sections
Customer: John DoeTotal: $150.00
```
--------------------------------
### Align Column Content with 'align' Prop
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/TableExamples.md
Control the alignment of content within a table column using the 'align' prop. Supported options are 'start' (default), 'center', and 'end'. This example demonstrates each alignment option.
```jsx
() => {
const data = [
{
column1: 'Start aligned column',
column2: 'Center',
column3: 'End',
},
{
column1: 'Start',
column2: 'Center aligned column',
column3: 'End',
},
{
column1: 'Start',
column2: 'Center',
column3: 'End aligned column',
},
];
const columns = [
{ title: 'Align', align: 'start', render: row => row.column1 },
{ title: 'Align', align: 'center', render: row => row.column2 },
{ title: 'Align', align: 'end', render: row => row.column3 },
];
return (
);
};
```
--------------------------------
### Create Dashboard Layout with Page and Grid Components
Source: https://github.com/vltansky/wix-design-system-docs/blob/main/components/PageExamples.md
This example shows how to build a responsive dashboard using the Page component, Page.Section for grouping, and Layout/Cell components for grid-based content organization. It includes interactive elements like PopoverMenu and DropdownBase.
```jsx
() => {
const renderCard = ({ title, height, stretchVertically = false }) => (
);
const renderToolsCard = () => (
);
return (
}>
More Actions
}
>
}
/>
}
/>
}
skin="destructive"
/>
}
/>
Time Period:
{({ toggle, selectedOption = {} }) => (
}
>
{selectedOption.value}
)}
}
/>
{renderCard({
title: 'Ad engagement',
height: '240px',
stretchVertically: true,
})}
{renderCard({
title: 'Ad impact',
height: '240px',
})}
{renderCard({
title: 'Statistics',
height: '180px',
})}
{renderCard({
title: 'Audience',
height: '240px',
})}
{renderCard({
title: 'Performance over time',
height: '240px',
})}
{renderCard({
title: 'Customer funnel',
height: '240px',
})}
}>
View All
}
/>
{renderToolsCard()}{renderToolsCard()}{renderToolsCard()}{renderToolsCard()}{renderToolsCard()}{renderToolsCard()}{renderToolsCard()}
);
};
```