Piplup
@piplup/react-aclComponents

HasAccess

Conditionally render content based on roles or permissions.

Import

import { HasAccess } from "@piplup/react-acl";

Basic example

<HasAccess permissions={["read"]}>
  <div>Visible to users with read permission</div>
</HasAccess>

Props

Prop

Type

Examples

  • fallback can be used to render alternative UI when access is denied.
  • loading prop can be supplied to show a loading placeholder while ACL data resolves.

On this page