Skip to content

Commit 7d570bc

Browse files
committed
Added example description
1 parent 4ba98fd commit 7d570bc

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

packages/react-core/src/components/Hero/Hero.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ import heroGradientStop1Dark from '@patternfly/react-tokens/dist/esm/c_hero_grad
99
import heroGradientStop2Dark from '@patternfly/react-tokens/dist/esm/c_hero_gradient_stop_2_dark';
1010
import heroGradientStop3Dark from '@patternfly/react-tokens/dist/esm/c_hero_gradient_stop_3_dark';
1111

12-
export interface GradientStops {
13-
stop1?: string;
14-
stop2?: string;
15-
stop3?: string;
16-
}
17-
1812
/** The main Hero component that allowws adjusting of its background images and gradients in different color modes (such as light and dark). */
1913

2014
export interface HeroProps extends Omit<React.HTMLProps<HTMLDivElement>, 'content'> {

packages/react-core/src/components/Hero/examples/Hero.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ propComponents: ['Hero', 'HeroBody']
1010

1111
### Basic
1212

13-
When
13+
When using a `<Hero>` with a background image, you can use the `<HeroBody>` to prevent text content from overlapping the background image, which helps ensure the text is more easily readable. Keep in mind that you should still check the color contrast when using the `gradientLight` or `gradientDark` properties.
14+
15+
You can omit the `<HeroBody>` for finer control over the text placement, or if no background image is applied to the `<Hero>`.
1416

1517
```ts file="HeroBasic.tsx"
1618

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Hero, HeroBody } from '@patternfly/react-core';
22

33
export const HeroBasic: React.FunctionComponent = () => (
4-
<Hero gradientLight={{ stop1: '#ff0000', stop2: '#00ff00', stop3: '#0000ff' }}>
5-
<HeroBody>The (super)hero content.</HeroBody>
4+
<Hero>
5+
<HeroBody>Basic hero content</HeroBody>
66
</Hero>
77
);

0 commit comments

Comments
 (0)