diff --git a/docs/src/pages/components/button-examples.mdx b/docs/src/pages/components/button-examples.mdx new file mode 100644 index 00000000000000..151b2b8dfde96c --- /dev/null +++ b/docs/src/pages/components/button-examples.mdx @@ -0,0 +1,84 @@ +import * as React from 'react'; +import { Stack, Button, IconButton, Tooltip } from '@mui/material'; +import SaveIcon from '@mui/icons-material/Save'; +import FavoriteIcon from '@mui/icons-material/Favorite'; + +export const meta = { + title: 'Components / Buttons / Examples', + description: 'Small, copy-pasteable Button examples including icon-only and accessibility tips.', +}; + +# Button — Code examples + +These short examples are ready to copy/paste into a component or playground. + + + + + + + + + + + + + + + + + + + + + + + + + +--- + +Accessibility tips + +- Icon-only buttons must have an accessible name (aria-label or visible text). +- Prefer wrapping icon-only buttons in a Tooltip for extra clarity. +- Verify keyboard focus order and visible focus styles. + +Copy-paste example (JSX) + +```jsx +import { Button, IconButton, Tooltip } from '@mui/material'; +import SaveIcon from '@mui/icons-material/Save'; + +function Example() { + return ( +
+ + + + + + + +
+ ); +} +```