Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to set <SimpleShowLayout direction> #9705

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

fzaninotto
Copy link
Member

@fzaninotto fzaninotto commented Mar 8, 2024

Problem

Writing a custom show layout by hand is cumbersome, because we have to decorate each field with <Labeled>.

Solution

Allow users to nest <SimpleShowLayout> of various direction.

image
export const BookShow = () => (
    <Show>
        <SimpleShowLayout>
            <TextField source="title" />
            <TextField source="summary" />
            <SimpleShowLayout
                direction="row"
                sx={{
                    padding: 0,
                    '& .ra-field-id': { width: 50 },
                    '& .ra-field-author': { width: 150 },
                }}
            >
                <TextField source="id" />
                <TextField source="author" />
                <NumberField source="year" />
            </SimpleShowLayout>
        </SimpleShowLayout>
    </Show>
);

## Problem

Writing a custom show layout by hand is cumbersome, because we have to decorate each field with `<Labeled>`.

## Solution

Allow users to nest `<SimpleShowLayout>` of various `direction`.
@fzaninotto fzaninotto merged commit 1509bed into next Mar 13, 2024
12 checks passed
@fzaninotto fzaninotto deleted the simpleshowlayout-direction branch March 13, 2024 17:07
@fzaninotto fzaninotto added this to the 5.0.0 milestone Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants