Skip to content

Commit

Permalink
docs: headline docs and demo (#3192)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahgm authored Jul 24, 2023
1 parent 09e11c6 commit 418cab9
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/content/components/headline/headline.demo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Body, Headline, Text } from '@marigold/components';

export default () => (
<Body>
<Headline level="3">Awesome Headline!</Headline>
<Text>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
</Text>
</Body>
);
56 changes: 56 additions & 0 deletions docs/content/components/headline/headline.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Headline
group: Content
caption: Component for headlines.
---

The main task of the `<Headline>` component is to serve as a title of a content section.
It should be used when you want to structure different parts of informations. That could be the page title, text headings or the title of different content parts.

The component has a `level` property that allows you to select a number from 1-6. This is a feature for SEO optimization, so that a rendered `level="5"` can look like a HTML H2 element.

Alternatively you can set this with the `size` prop.
With the `size` prop you can style the different levels.

## Usage

### Import

```tsx
import { Headline } from '@marigold/components';
```

### Appearance

<AppearanceTable component={title} />

### Props

<PropsTable
props={[
{
property: 'level',
type: 'string',
description: 'Set a different level from theme, values are from 1 - 6.',
default: `1`,
},
{
property: 'align',
type: 'left | center | right',
description: 'Set the align of the headline.',
},
{
property: 'color',
type: 'string',
description: 'Set the color of the headline.',
},
]}
/>

## Examples

### Headline with Text

In this example you see a simple headline with some text.

<ComponentDemo file="./headline.demo.tsx" />

2 comments on commit 418cab9

@vercel
Copy link

@vercel vercel bot commented on 418cab9 Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

marigold-docs – ./

marigold-docs.vercel.app
marigold-docs-marigold.vercel.app
marigold-docs-git-main-marigold.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 418cab9 Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

marigold-storybook – ./

marigold-storybook-git-main-marigold.vercel.app
marigold-storybook-marigold.vercel.app
marigold-latest.vercel.app

Please sign in to comment.