@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
70 lines (65 loc) • 2.23 kB
TypeScript
import { SCCategoryType } from '@selfcommunity/types';
import { CategoryFollowButtonProps } from '../CategoryFollowButton';
import { WidgetProps } from '../Widget';
export interface CategoryProps extends WidgetProps {
/**
* Category Id
* @default null
*/
categoryId?: number;
/**
* Category Object
* @default null
*/
category?: SCCategoryType;
/**
* Hides this component
* @default false
*/
autoHide?: boolean;
/**
* Props to spread to follow button
* @default {}
*/
categoryFollowButtonProps?: CategoryFollowButtonProps;
/**
* Prop to show category followers as secondary text
* @default true
*/
showFollowers?: boolean;
/**
* Prop to show category name tooltip
* @default false
*/
showTooltip?: boolean;
/**
* Any other properties
*/
[p: string]: any;
}
/**
* > API documentation for the Community-JS Category component. Learn about the available props and the CSS API.
*
*
* This component renders a category item.
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/Category)
#### Import
```jsx
import {Category} from '@selfcommunity/react-ui';
```
#### Component Name
The name `SCCategory` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCCategory-root|Styles applied to the root element.|
|categoryImage|.SCCategory-category-image|Styles applied to category image element.|
|title|.SCCategory-title|Styles applied to the title element.|
|actions|.SCCategory-actions|Styles applied to action section.|
|primary|.SCCategory-primary|Styles applied to category primary section (when showTooltip prop is set to true)|
|secondary|.SCCategory-secondary|Styles applied to category secondary section (when showTooltip prop is set to true)|
|followed|.SCCategory-followed|Styles applied to a category item when it is followed|
|autoFollowed|.SCCategory-auto-followed|Styles applied to a category item when auto followed is set to true|
* @param inProps
*/
export default function Category(inProps: CategoryProps): JSX.Element;