Skip to content

Conversation

brightsider
Copy link

Solution for #5034

@mui-bot
Copy link

mui-bot commented Jul 17, 2025

Netlify deploy preview

https://deploy-preview-5105--mui-toolpad-docs.netlify.app/

Generated by 🚫 dangerJS against 6eef031

@brightsider
Copy link
Author

example of usage:

const renderName = (data: Model) => (
  <div className="flex items-center gap-2">
    <Avatar src={data.logo} sx={{ width: 32, height: 32 }}>
      <Typography fontWeight={500} textAlign="center">
        {nameToAvatar(data.name)}
      </Typography>
    </Avatar>
    <p>{data.name}</p>
  </div>
);

const field: DataField = {
  flex: 2,
  field: 'name',
  editable: true,
  type: 'string',
  sortable: false,
  filterable: false,
  headerName: 'Name',
  renderCell: ({ row }) => renderName(row as Model),
  renderShowField: ({ data, headerName }) => {
    return (
      <Grid key="name" size={{ sm: 12, xs: 12 }}>
        <Paper sx={{ px: 2, py: 1 }}>
          <Typography variant="overline">{headerName}</Typography>
          {renderName(data as Model)}
        </Paper>
      </Grid>
    );
  },
};
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: toolpad-core Abbreviated to "core"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants