Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
action-sheet-rn
Advanced tools
Probably the most declarative API for ActionSheets in React Native
Probably the most declarative API for ActionSheets in React Native
$ yarn add action-sheet-rn
import { ActionSheet, SheetItem, SheetDivider } from "action-sheet-rn";
// Icons can be defined as:
// const ShareIcon = <Image source={require("./share.png")} />
// const CreateIcon = <Image source={require("./create.png")} />
// const RemoveIcon = <Image source={require("./remove.png")} />
// const LocateIcon = <Image source={require("./locate.png")} />
// const ShareIcon = <Image source={require("./remove.png")} />
const App = ({ isVisible }) =>
isVisible && (
<ActionSheet title="What do you want to do?">
<SheetItem Icon={ShareIcon} onPress={handleShare}>
Share
</SheetItem>
<SheetItem Icon={CreateIcon} onPress={handleCreate}>
Create
</SheetItem>
<SheetItem Icon={RemoveIcon} type="remove" onPress={handleRemove}>
Remove
</SheetItem>
<SheetDivider />
<SheetItem Icon={LocateIcon} onPress={handleLocate}>
Locate
</SheetItem>
<SheetItem type="cancel" onPress={handleCancel}>
Cancel
</SheetItem>
</ActionSheet>
);
It displays a native ActionSheet
using ActionSheetIOS.
On a SheetItem
, you can specify a type
of value cancel | remove
that will allow to customize its style (positionning the cancel button to the bottom and adding the red style of the remove one).
The Icon
prop has no effect on the iOS Action Sheet. It's only relevant for Android
It displays a custom and JavaScript implementation of a Modal Bottom Sheet from the Material Design Spec. For now, it's not implemented 100%, but I really hope it will (missing the gesture handling + the number of visible items etc..)
On Android, the SheetItem
with the cancel
type won't be visible. Instead, the lib will handle the click on the opaque zone as a cancellation (only when the type="cancel"
is provided to keep consistency between iOS and Android).
You can also pass an Icon
props to the SheetItem
so that it adds a little Icon on the left, always following the spec concerning size / margins.
The remove
type as no specific effects on Android.
FAQs
Probably the most declarative API for ActionSheets in React Native
We found that action-sheet-rn demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.