Check out our restructured interface and a bold, colorful design that reflects the vibrance of your team. Try it out early and get a chance to influence how we build the next generation of Atlassian.
` and \`\` tags for code blocks.
```jsx
Code blocks with {` and `}
{` Example markup snippet
Sona si Latine loqueris. Sentio aliquos togatos contra me conspirare.
`}
```
--------------------------------
### Default Pressable Example
Source: https://atlassian.design/components/primitives/pressable/examples
Demonstrates a basic Pressable component without any custom styling, only default focus styles. Use this as a starting point for custom button implementations.
```jsx
import React, { useCallback } from 'react';
import Pressable from '@atlaskit/primitives/pressable';
export default function Default(): React.JSX.Element {
const handleClick = useCallback(() => {
console.log('Clicked');
}, []);
return Pressable ;
}
```
--------------------------------
### Inline Alignment Control Example
Source: https://atlassian.design/components/primitives/inline
Dynamically changes the inline alignment of elements within an Inline primitive using a button click. The alignment cycles through 'start', 'center', and 'end'.
```jsx
import React, { useCallback, useState } from 'react';
import Button from '@atlaskit/button/new';
import Heading from '@atlaskit/heading';
import { Box, Inline, Stack } from '@atlaskit/primitives/compiled';
import ExampleBox from '../shared/example-box';
const alignmentValues = ['start', 'center', 'end'] as const;
export default function Example(): React.JSX.Element {
const [alignmentIndex, setAlignmentIndex] = useState<0 | 1 | 2>(0);
const nextIndex = ((alignmentIndex + 1) % alignmentValues.length) as 0 | 1 | 2;
const changeAlignment = useCallback(() => {
setAlignmentIndex(nextIndex);
}, [nextIndex]);
return (
Inline alignment
);
}
```
--------------------------------
### Install CSS Reset and Design Tokens
Source: https://atlassian.design/get-started/develop/atlassians
Install the necessary dependencies for your style environment, including CSS reset and design tokens.
```bash
yarn add @atlaskit/css-reset @atlaskit/tokens
```
--------------------------------
### Example Page Layout with Left Sidebar and Keyboard Shortcut
Source: https://atlassian.design/components/page-layout
This example demonstrates how to integrate the `ExpandLeftSidebarKeyboardShortcut` component within a `PageLayout`. Ensure the `ExpandLeftSidebarKeyboardShortcut` is a child of a component that provides the Page Layout context.
```javascript
/** * @jsxRuntime classic * @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports import { jsx } from '@emotion/react'; import { Content, LeftSidebar, Main, PageLayout } from '@atlaskit/page-layout'; import { Header, NavigationHeader, SideNavigation } from '@atlaskit/side-navigation'; import { ExpandLeftSidebarKeyboardShortcut, SlotLabel } from '../common'; export default (): jsx.JSX.Element => { return ( Sidebar Header Main Content ); };
```
--------------------------------
### Side Navigation with Header and Footer
Source: https://atlassian.design/components/side-navigation
Use NavigationHeader and NavigationFooter to customize the header and footer of the side navigation. This example shows a complete side navigation setup with a header and footer.
```jsx
import React from 'react'; import PremiumIcon from '@atlaskit/icon/core/premium'; import ProjectIcon from '@atlaskit/icon/core/project'; import Link from '@atlaskit/link'; import { Footer, Header, NavigationContent, NavigationFooter, NavigationHeader, SideNavigation,} from '@atlaskit/side-navigation'; import AppFrame from '../common/app-frame'; const Example = (): React.JSX.Element => { return ( ( <> {/* eslint-disable-next-line @atlaskit/design-system/no-html-anchor */} {children} > )} iconBefore={ } description="Next-gen software" >
Concise Systems } description={ Give feedback {' ∙ '} About this project } >
You're in a next gen-project ); }; export default Example;
```
--------------------------------
### Flex Basic Example
Source: https://atlassian.design/components/primitives/flex/examples
Demonstrates the basic usage of the Flex component to control content alignment. Use this to create flexible layouts that adapt to different screen sizes or content changes.
```javascript
import React, { useCallback, useState } from 'react';
import Button from '@atlaskit/button/new';
import { Code } from '@atlaskit/code';
import Heading from '@atlaskit/heading';
import { Box, Flex, Stack } from '@atlaskit/primitives/compiled';
import ExampleBox from '../shared/example-box';
const alignmentValues = ['start', 'center', 'end'] as const;
export default function Example(): React.JSX.Element {
const [alignmentIndex, setAlignmentIndex] = useState<0 | 1 | 2>(0);
const nextIndex = ((alignmentIndex + 1) % alignmentValues.length) as 0 | 1 | 2;
const changeAlignment = useCallback(() => {
setAlignmentIndex(nextIndex);
}, [nextIndex]);
return (
Justify content {alignmentValues[alignmentIndex]}
);
}
```
--------------------------------
### Dynamic Table Empty State Example
Source: https://atlassian.design/components/dynamic-table/examples
Shows how to display a custom message when a dynamic table has no content using the `emptyView` prop. This is useful for guiding users on how to populate the table.
```javascript
import React from 'react';
import { DynamicTableStateless } from '@atlaskit/dynamic-table';
import { head } from './content/sample-data';
const EmptyViewExample = (): React.JSX.Element => (
The table is empty and this is the empty view}
/>
);
export default EmptyViewExample;
```
--------------------------------
### Popup Select with Custom Placement
Source: https://atlassian.design/components/select/popup-select
Control the positioning of the popup select relative to its trigger using the `popperProps` with the `placement` property. This example places the popup to the right and aligned with the start of the trigger.
```javascript
import React from 'react';
import Button from '@atlaskit/button/new';
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
import { PopupSelect } from '@atlaskit/select';
const options = [
{
label: 'States',
options: [
{ label: 'Adelaide', value: 'adelaide' },
{ label: 'Brisbane', value: 'brisbane' },
{ label: 'Melbourne', value: 'melbourne' },
{ label: 'Perth', value: 'perth' },
{ label: 'Sydney', value: 'sydney' },
{ label: 'Hobart', value: 'hobart' },
],
},
{
label: 'Territories',
options: [
{ label: 'Canberra', value: 'canberra' },
{ label: 'Darwin', value: 'darwin' },
],
},
];
const PopupSelectExample = (): React.JSX.Element => {
return (
(
)}
/>
);
};
export default PopupSelectExample;
```
--------------------------------
### Add init entry point for theme CSS files
Source: https://atlassian.design/components/tokens/changelog
Provides a new init entry point for easily importing all theme CSS files, including light, dark, spacing, and typography.
```typescript
import '@atlaskit/tokens/dist/css/light.css';
import '@atlaskit/tokens/dist/css/dark.css';
import '@atlaskit/tokens/dist/css/spacing.css';
import '@atlaskit/tokens/dist/css/typography.css';
```