Skip to content

Commit

Permalink
Merge pull request #2707 from marmelab/simple-show-layout-style
Browse files Browse the repository at this point in the history
[RFR] Fix outdated SimpleShowLayout doc about custom styles
  • Loading branch information
Gildas Garcia authored Dec 31, 2018
2 parents 30eb38e + 3e3c8f4 commit cd26b2e
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions docs/Show.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ React-admin provides guessers for the `List` view (`ListGuesser`), the `Edit` vi
The `<SimpleShowLayout>` component receives the `record` as prop from its parent component. It is responsible for rendering the actual view.
The `<SimpleShowLayout>` renders its child components line by line (within `<div>` components).
The `<SimpleShowLayout>` renders its child components line by line (within `<div>` components) inside a material-ui `<CardContent/>`.
```jsx
export const PostShow = (props) => (
Expand All @@ -200,28 +200,7 @@ export const PostShow = (props) => (
);
```
It is possible to override its style by specifying the `style` prop, for example:
```jsx
const styles = {
container: {
display: 'flex',
},
item: {
marginRight: '1rem',
},
};

export const PostShow = (props) => (
<Show {...props}>
<SimpleShowLayout style={styles.container}>
<TextField source="title" style={styles.item} />
<RichTextField source="body" style={styles.item} />
<NumberField source="nb_views" style={styles.item} />
</SimpleShowLayout>
</Show>
);
```
It accepts a `className` prop to let you override the style of the `<CardContent/>`.
## The `<TabbedShowLayout>` component
Expand Down

0 comments on commit cd26b2e

Please sign in to comment.