Neptunium, Promethium, Manganese

    shipwreck

    3.5.2 • Public • Published

    Shipwreck

    A simple generic web based UI for browsing any Siren Hypermedia API.

    Enter an API endpoint to render all the entity's properties, links, actions, and sub-entities.

    entity

    You can access Shipwreck hosted on github.io.

    Or download the npm package and use it as a base for building your own UI.

    Note

    Shipwreck includes the following extension that are not part of the default spec.

    The "checked" field property

    Shipwreck supports the field having a checked property for inputs of type radio and checkbox

    {
      "title": "Sign Me Up For The Newsletter",
      "name": "newsletter",
      "type": "checkbox",
      "value": "yes",
      "checked": true,
    }
    

    The "select" field type

    select is not a valid field type in the Siren spec, but is supported by Shipwreck. You can specify options using options property, or by having options array assigned to value.

    Options

    Options for a datalist, or select can be provided via an options property.

    {
      "title": "Example Text Control with Data List",
      "name": "autocomplete-text-control",
      "type": "text",
      "value": "",
      "options": [
        { "value": "Blue" },
        { "value": "Green" }
      ]
    }
    

    Options can also be used for radio, and checkbox.

    {
      "title": "Example Radio",
      "name": "radio-control",
      "type": "radio",
      "value": "",
      "options": [
        { "title": "Blue", "value": "blue", "checked": true },
        { "title": "Green", "value": "green" }
      ]
    }
    

    Alternatively, options can be assigned to value as per this proposal.

    {
      "title": "Example Select Control",
      "name": "select-control",
      "type": "select",
      "value": [
        { "title": "Blue", "value": "blue" },
        { "title": "Green", "value": "green", "selected": true }
      ]
    }
    

    Install

    npm i shipwreck

    DownloadsWeekly Downloads

    5

    Version

    3.5.2

    License

    ISC

    Unpacked Size

    195 kB

    Total Files

    25

    Last publish

    Collaborators

    • stephenwright