suiss/ui ยท Block
Log Activity
An admin activity log grouped by day, with a type filter and expandable before-and-after details.
Log Activity is an open-source block from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
An audit log that groups events by day, each with an icon for its type, the person, the action, the target and a time. Events that changed a value expand to show a before-and-after comparison, and a type filter and Export button sit in the header. It sits in a Sidebar with admin navigation that opens as a sheet from the trigger on mobile. Use it for audit trails, change history or admin activity pages.
Replace events with entries from your audit log API; each has a day, time, actor, action, target, kind and an optional before-and-after diff. kinds sets each event type's icon and tint, and nav the shell navigation. Give the Export button a handler.
Installation
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
- Install the following dependencies:
-
Add the pieces it builds on: Button, Collapsible, Select, Sidebar.
-
Copy and paste the following code into your project.
- Update the import paths to match your project setup.
Usage
Web preview
An admin screen with a collapsing Header and large title, a scrollable ChipGroup to filter by event type (Price, Content, Security, Order, User), and events grouped under day headings. Events that carry a change expand with Collapsible to show the before and after values. A TabBar at the bottom switches between Users, Roles, Activity and Settings; only Activity has content in the sample.
Replace EVENTS with your audit log and KINDS with your event types. Wire onFilterChange, onExport (receives the current filter) and onNavigate (receives the selected tab) to your app.
Installation
- Install the following dependencies:
-
Add the pieces it builds on: Button, Chip, Collapsible, Header, Icon, Screen, Tab Bar, Text.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/log-activity.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Button, Chip, Collapsible, Header, Icon, Screen, Tab Bar, Text.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/log-activity.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Button, Chip, Collapsible, Header, Icon, Screen, Tab Bar, Text.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/log-activity.tsx:
- Update the import paths to match your project setup.
-
Target iOS 17 or later.
-
Add the Swift package to your app:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Apply the Compose compiler plugin, enable Compose, set
compileSdkto 37 or higher andminSdkto 24 or higher, and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.