UNPKG

@softr/sdk

Version:

The SDK for building Softr apps on TanStack Start. It lets an app interact with Softr: auth, datasources, workflows and integrations.

31 lines (30 loc) • 783 B
import { Visibility } from "./visibility.js"; import { ReactNode } from "react"; //#region src/route/audience.d.ts type Props = { visibility: Visibility; children: ReactNode; fallback?: ReactNode; }; /** * Renders `children` to the visitors a rule admits, and `fallback` to the rest. * * Use it to hide parts of the tree. The UI for visibility is accessible by the * builder in Studio. * * Requires the root route to resolve {@link getSoftrContext}. * * @example * const membersOnly = defineVisibility({ userGroupTypes: ["LOGGED_IN_USERS"] }) * * <Audience visibility={membersOnly} fallback={<Upgrade />}> * <DangerZone /> * </Audience> */ declare function Audience({ visibility, children, fallback }: Props): ReactNode; //#endregion export { Audience };