Back to React Native

README

plugins/remark-snackplayer/README.md

latest3.1 KB
Original Source
<h1 align="center">Remark SnackPlayer</h1> <p align="center">Remark plugin to embed <a href="https://snack.expo.dev/">Expo Snack's</a> using Code Blocks</p>

Usage

This plugin parses codeblocks with language set as SnackPlayer and replaces them with embedded Expo's SnackPlayers, you can also provide parameters along with the codeblock to set some basic details.

Example Code Block

```SnackPlayer name=Hello%20World description=This%20is%20a%20description
import React from 'react';
import { Text, View } from 'react-native';

const YourApp = () => {
  return (
    <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
      <Text>Try editing me! 🎉</Text>
    </View>
  );
}

export default YourApp;
```

The above code snippet would look like this:

Parameters

NameDescriptionDefault
nameSnackPlayer name"Example"
descriptionDescription of the example"Example usage"
dependenciesAdditional dependencies, eg. "expo-constant"""
platformExample platform"web"
supportedPlatformsSupported platforms"ios,android,web"
themeSnackPlayer theme, "light" or "dark""light"
previewPreview visible, "true" or "false""true"
deviceAppearanceSets the preview mobile device appearance, "light" or "dark""light"
loadingiFrame loading attribute, "auto", "lazy" or "eager""lazy"
deviceAndroidEmulator type used for Android, see Appetize optionspixel4
deviceIosSimulator type used for iOS, see Appetize optionsiphone12

Styling

To style the Snack Player wrapper you can use .snack-player class.