oruga icon indicating copy to clipboard operation
oruga copied to clipboard

Support for Checkbox Button?

Open major-mayer opened this issue 1 year ago • 4 comments

Description

I'm coming from Buefy and am currently checking which of the components from Buefy are missing in Orgua. Is it possible to add the "checkbox button" to Orgua as well: https://buefy.org/documentation/checkbox#checkbox-button I did my research on the website but couldn't find an equivalent to this component.

Why Oruga need this feature

If I understand it correctly, Orgua is the spiritual successor of Buefy. So to make the migration path easy, it would be nice if for all components from Buefy there is an equivalent in Orgua.

major-mayer avatar Jan 08 '24 08:01 major-mayer

@jtommy could you check if this is just a styling topic or do we need to add some logic to it?

mlmoravek avatar Jan 08 '24 13:01 mlmoravek

The very similar radio button would also be very much appreciated 💕 https://buefy.org/documentation/radio#radio-button

myrsky-mapita avatar Jan 09 '24 14:01 myrsky-mapita

@myrsky-mapita Maybe you can use the tab components with toggle type instead for now?

mlmoravek avatar Feb 21 '24 13:02 mlmoravek

For information, I mimic buefy radio buttons with a rootClass="button" , checkedClass="is-primary" and this styling :

.b-radio.radio.button {
  input[type="radio"] {
    position: absolute;
    left: 0;
    opacity: 0;
    outline: none;
    z-index: -1;
  }
  .control-label {
    padding-left: 0px;
  }
}

Maybe worth adding to theme-bulma

This is the complete radioButton component I created for migration :

<template>
  <o-radio
    rootClass="button"
    checkedClass="is-primary"
    v-bind="attrs"
  >
    <template v-for="(_, slot) of $slots" v-slot:[slot]="scope">
      <slot :name="slot" v-bind="scope" />
    </template>
  </o-radio>
</template>

<script>
export default {
  setup(props,context) {
    const attrs=context.attrs
    return {attrs}
  }
};
</script>

<style lang="scss">
.b-radio.radio.button {
  input[type="radio"] {
    position: absolute;
    left: 0;
    opacity: 0;
    outline: none;
    z-index: -1;
  }
  .control-label {
    padding-left: 0px;
  }
}
</style>

dauriata avatar Apr 27 '24 17:04 dauriata