Skip to main content

User

Interfaces

UserProps

API documentation for the Community-JS Widget component. Learn about the available props and the CSS API.

Import

import {Widget} from '@selfcommunity/react-ui';

Component Name

The name SCWidget can be used when providing style overrides in the theme.

CSS

Rule NameGlobal classDescription
root.SCWidget-rootStyles applied to the root element.

Extends

Indexable

[p: string]: any

Properties

PropertyTypeDescriptionInherited from
actions?ReactNodeProp to add actions

Default
null
-
badgeContent?anyBadge content to show as user avatar badge if show reaction is true.-
buttonProps?ButtonBasePropsProps to spread to the button

Default
{}
-
className?stringOverrides or extends the styles applied to the component.

Default
null
WidgetProps.className
followConnectUserButtonProps?FollowUserButtonProps | FriendshipButtonPropsProps to spread to follow/friendship button

Default
{}
-
handleIgnoreAction?(u: any) => voidHandles actions ignore

Default
null
-
isGroupAdmin?booleanIf true, shows a custom label next to the user username

Default
false
-
secondary?ReactNode--
showFollowers?booleanProp to show user followers as secondary text

Default
false
-
user?SCUserTypeUser Object

Default
null
-
userId?numberUser Id

Default
null
-

Functions

User()

User(inProps): JSX.Element

API documentation for the Community-JS User component. Learn about the available props and the CSS API.

This component renders a user item. Take a look at our demo component here

Import

import {User} from '@selfcommunity/react-ui';

Component Name

The name SCUser can be used when providing style overrides in the theme.

CSS

Rule NameGlobal classDescription
root.SCUser-rootStyles applied to the root element.
avatar.SCUser-avatarStyles applied to the avatar element.
staffBadgeLabel.SCUser-staff-badge-labelStyles applied to the staff badge label element.

Parameters

ParameterTypeDescription
inPropsUserProps

Returns

JSX.Element

Source

packages/react-ui/src/components/User/User.tsx:130


UserSkeleton()

UserSkeleton(props): JSX.Element

API documentation for the Community-JS User Skeleton component. Learn about the available props and the CSS API.

Import

import {UserSkeleton} from '@selfcommunity/react-ui';

Component Name

The name SCUser-skeleton-root can be used when providing style overrides in the theme.

CSS

Rule NameGlobal classDescription
root.SCUser-skeleton-rootStyles applied to the root element.

Parameters

ParameterType
propsWidgetProps

Returns

JSX.Element

Source

packages/react-ui/src/components/User/Skeleton.tsx:39