Back to React Spectrum

Component Name

packages/dev/docs/src/template.mdx

2022-12-162.3 KB
Original Source

{/* Copyright 2020 Adobe. All rights reserved. This file is licensed to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */}

import {Layout} from '@react-spectrum/docs'; export default Layout;

import docs from 'docs:@react-spectrum/COMPONENT_NAME'; import {HeaderInfo, PropTable, PageDescription} from '@react-spectrum/docs'; import packageData from '@react-spectrum/COMPONENT_NAME/package.json';

jsx
import {Component} from '@react-spectrum/COMPONENT_NAME';

category: Categoryname keywords: []

Component Name

<PageDescription>{docs.exports.Component.description}</PageDescription>

<HeaderInfo packageData={packageData} componentNames={['Component']} sourceData={[ {type: 'Spectrum', url: 'https://spectrum.adobe.com/page/button/'} ]} />

Example

tsx
<Button variant="accent">Button</Button>

Content

If the component has a children prop that accepts any type of content (e.g. ReactNode), include this section. Please include a note about how to internationalize the content.

Value

If the component displays or allows a user to input a value, include this section.

Labeling

If the component supports a label prop, include this section. Please include a note about how to internationalize the content.

Events

If the component supports event props, include this section. Only cover the events that are important to the main functionality of the component.

Validation

If the component supports validation props, include this section.

Props

<PropTable component={docs.exports.Component} links={docs.links} />

Visual options

Show examples of all variants and visual props here with links to the design website for more usage details. Examples can be grouped together for conciseness.

Sample Option

View guidelines