@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
94 lines (85 loc) • 2.89 kB
TypeScript
import React from 'react';
import { ButtonBaseProps, TypographyProps } from '@mui/material';
import { WidgetProps } from '../../components/Widget';
export interface BaseItemButtonProps extends Pick<WidgetProps, Exclude<keyof WidgetProps, 'id'>> {
/**
* Id of user object
* @default null
*/
id?: string;
/**
* Overrides or extends the styles applied to the component.
* @default null
*/
className?: string;
/**
* If `true`, the base item is a button (using `ButtonBase`). Props intended
* for `ButtonBase` can then be applied to `ButtonBaseProps` prop.
* @default false
* @deprecated checkout [ListItemButton](/api/list-item-button/) instead
*/
button?: boolean;
/**
* Props to spread to ButtonBase
* @default {}
*/
ButtonBaseProps?: ButtonBaseProps;
/**
* Image to insert into the item
* @default null
*/
image?: React.ReactNode;
/**
* If true, the children won't be wrapped by a Typography component.
* This can be useful to render an alternative Typography variant by wrapping the children (or primary) text, and optional secondary text with the Typography component.
* @default false
*/
disableTypography?: boolean;
/**
* The main content element
*/
primary?: React.ReactNode;
/**
* Props to spread to Primary Typography
* @default {component: 'span', variant: 'body1'}
*/
primaryTypographyProps?: TypographyProps;
/**
* The secondary content element.
*/
secondary?: React.ReactNode;
/**
* Props to spread to Secondary Typography
* @default {component: 'p', variant: 'body2'}
*/
secondaryTypographyProps?: TypographyProps;
/**
* The actions of the item
*/
actions?: React.ReactNode;
/**
* Any other properties
*/
[p: string]: any;
}
/**
* > API documentation for the Community-JS BaseItemButton component. Learn about the available props and the CSS API.
#### Import
```jsx
import {BaseItemButton} from '@selfcommunity/react-ui';
```
#### Component Name
The name `BaseItemButton` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCBaseItemButton-root|Styles applied to the root element.|
|content|.SCBaseItemButton-content|Styles applied to the content element.|
|image|.SCBaseItemButton-image|Styles applied to image section.|
|text|.SCBaseItemButton-text|Styles applied to text section.|
|primary|.SCBaseItemButton-primary|Styles applied to primary section.|
|secondary|.SCBaseItemButton-secondary|Styles applied to secondary section.|
|actions|.SCBaseItemButton-actions|Styles applied to actions section.|
* @param inProps
*/
export default function BaseItemButton(inProps: BaseItemButtonProps): JSX.Element;